Hi there. I want to make my function run in addEvent but i get problems.
I have added a global function in global.lua that i want to use for other things
and when people enter a certain SQM i want orange text(monster alike) to pop at a certain position
The first message appears without problems . then i get a warning that argument #3 is unsafe in addEvent and later in my function (monsterSayPos) attempt to index local 'creature' (a number value)
I have added a global function in global.lua that i want to use for other things
Code:
function monsterSayPos(creature,text,position)
creature:say(text,TALKTYPE_ORANGE_1,false,nil,position)
end
Code:
function onStepIn(creature, item, position, fromPosition)
local pos1 = { x = position.x + 3, y = position.y, z = position.z}
local pos2 = { x = position.x + 5, y = position.y, z = position.z}
if creature:getStorageValue(2) == 3 then
creature:setStorageValue(2,4)
monsterSayPos(creature,"temp 1", pos1)
addEvent(monsterSayPos,2000,creature,"temp2",pos2)
end
end
The first message appears without problems . then i get a warning that argument #3 is unsafe in addEvent and later in my function (monsterSayPos) attempt to index local 'creature' (a number value)