andu
Sold 649 scripts, 25 maps and 9 events!
Have to learn how does self thing works in TFS 1.x+ and have to use a local function for this. Future, I'll move it to libs so no workarounds.
Lua:
local function addTreasureLoot()
self:addItem(2195, 1)
return true
end
function onSay(player, words, param)
local chest = Game.createItem(1740, 1, player:getPosition())
chest:addTreasureLoot() -- adding loot to chest
return true
end
Code:
8: attempt to call method 'addTreasureLoot' (a nil value)
Last edited: