luagetThingPosition() Thing not found
luaGetThingFromPos() Tile not found
line 7: attempt to get length of local 'k' <a number value>
stack traceback:
in function <>
-- this is the error --
-- script --
i tried with all shit, using TFS 0.4 newest rev
rep for all who atleast try and help
luaGetThingFromPos() Tile not found
line 7: attempt to get length of local 'k' <a number value>
stack traceback:
in function <>
-- this is the error --
-- script --
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local table = {2700, 7024, 2719, 2710, 2718, 3608, 3609, 3616, 3615, 3607}
local grass = 4526
local ret = RETURNVALUE_NOERROR
if item.itemid == 1945 or item.itemid == 1946 and item.uid == 5000 then
for _, k in ipairs(table) do
ret = doTileAddItemEx(getThingFromPos(getThingPos(grass)).uid, doCreateItemEx(k[1][math.random(1, #k[1])]))
end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
rep for all who atleast try and help
Last edited: