hello my friends,
i'm working in a summon action script
and I want to remove the summon after x time, and put exhaustion (y time) on this script .. i have tryed make this with "addEvent" but i dont know how to make it correctly...
TFS 1.3, 10.98 version
i'm using this script as a base:
could you help me?
i'm working in a summon action script
and I want to remove the summon after x time, and put exhaustion (y time) on this script .. i have tryed make this with "addEvent" but i dont know how to make it correctly...
TFS 1.3, 10.98 version
i'm using this script as a base:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local position = player:getPosition()
local monster = Game.createMonster("Barbarian Bloodwalker", position)
if monster then
player:addSummon(monster)
position:sendMagicEffect(CONST_ME_MAGIC_RED)
monster:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
addEvent(doRemoveCreature, 3000, monster) -- <-- i've put it to remove the summon after 3 seconds(but error, cause unsafe)
else
player:sendCancelMessage("There is not enough room.")
position:sendMagicEffect(CONST_ME_POFF)
end
return false
end
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/summonsign.lua:onUse
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/actions/scripts/other/summonsign.lua:19: in function <data/actions/scripts/other/summonsign.lua:2>
could you help me?
Last edited: