Oneda
Aspiring Spriter
So guys, How should I get the player target inside a new function I'm making? (Target isnt a creature, should be a tile/item)
Console shows me this error:
LUA:
function isGathered(cid, decayId)
for _, tPlayer in ipairs(Game.getPlayers()) do
local target = cid:getTarget()
target:transform(decayId)
target:decay()
return true
end
end
Console shows me this error:
Code:
data/lib/compat/compat.lua:121: attempt to index local 'cid' (a number value)
stack traceback:
[C]: in function '__index'
data/lib/compat/compat.lua:121: in function 'isGathered'
data/actions/scripts/gather.lua:6: in function <data/actions/scripts/gather.lua:3>