Anakonta
Senior User
- Joined
- Oct 5, 2010
- Messages
- 536
- Reaction score
- 10
Witam, mam problem z moim skryptem. Gdy gracz nadejdzie na dany ground powinno zamieni? dany item kt?ry znajduje si? w bagu a bag tam gdzie slot na naszyjniki.
Skrypt:
Do movements.xml doda?em:
Taki error wywala mi w silniku kiedy najd? na dany groud:
Skrypt:
Code:
local item = {
[7559] = {szukanyZamienicNaId = 7560, storage = 85426, ile = 1},
[7558] = {szukanyZamienicNaId = 7559, storage = 85426, ile = 2}
}
function onStepIn(cid, item, pos)
local conf = item[szukanyItemid]
local skillbag = getPlayerSlotItem(cid,CONST_SLOT_NECKLACE)
if isPlayer(cid) == 1 then
if (getPlayerStorageValue(cid, conf.storage) == conf.ile) then
if(skillbag.uid > 0) then
for i = 0, getContainerSize(skillbag.uid) do
local skillItem = getContainerItem(skillbag.uid, i)
if(skillItem.uid > 0 and skillItem.itemid == conf.szukanyItemid) then
doTransformItem(skillItem.uid, conf.szukanyZamienicNaId)
break
end
end
end
end
end
end
Code:
<movevent event="StepIn" itemid="996" script="zamiana.lua" />
Taki error wywala mi w silniku kiedy najd? na dany groud:
Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/zamiana.lua:onStepIn
data/movements/scripts/zamiana.lua:16: attempt to index local 'conf' (a nil value)