Code:
local config =
{
time = 60, -- seconds
teleportId = 5023,
bosses =
{ -- Monster Name, Teleport Position, aid, optional brothers name
["Desintegrated Ghazbaran"] = { pos={ x=247, y=617, z=6}, aid=12666},
}
}
local function changeBack(position)
doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
if config.bosses[getCreatureName(target)].brother then if(isMonster(getCreatureByName(config.bosses[getCreatureName(target)].brother))) then return true end end
doItemSetAttribute(getTileItemById(config.bosses[getCreatureName(target)].pos, config.teleportId).uid, "aid", config.bosses[getCreatureName(target)].aid)
doCreatureSay(cid, "Go into the teleport in "..config.timeToRemove.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
addEvent(changeBack, config.time * 1000, t.pos)
end
return true
end
<event type="kill" name="Ghaz" event="script" value="script.lua"/>
When i kill boss, boss dont move dont have name and hp and attack me
Code:
Errors in .exe
[Error - CreatureScript Interface]
Description:
<luaDoItemSetAtribute> Item not found
data/creaturescripts/scripts/script.lua:onKill
Description:
data/creaturescripts/scripts/script.lua:17: attempt to concatenate field 'timeToRemove' <a nil value>
stack traceback:
data/creaturescripts/scripts/script.lua:17: in function <data/creaturescripts/scripts/script.lua:13>