D
Deleted member 49793
Guest
Hey guys i have a script which is ment to take 2 items and turn them into 1 with the pull of a lever and im getting this script:
This is the script:
Code:
[Error - Action Interface]
data/actions/scripts/forging.lua
Description:
data/actions/scripts/forging.lua:2: table index is nil
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/forging.lua)
This is the script:
Code:
local config = {
[FIRSTITEM] = {x = 100, y = 1104, z = 8},
[SECONDITEM] = {x = 100, y = 100, z = 8}
}
local new_item = {
[ITEM] = {x = 100, y = 100, z = 8}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = config[item.itemid]
for i = 1, 2 do
local check = getThingFromPos(v[1][i], v)
if check.itemid == v then
local c = new_item[item.itemid]
local c_check = getThingFromPos(c[1], c)
if c_check.itemid <= 0 then
doCreateItem(c, 1, c[1])
doRemoveItem(check[i].uid, 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
break
else
return doPlayerSendCancel(cid, "The item is already there.")
end
else
return doPlayerSendCancel(cid, "The items are not correct.")
end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end