Zakhran
Pace
Hi guys can u help me with a action?
Remove Wall after killing a x boss in a room... thanks rep++
Remove Wall after killing a x boss in a room... thanks rep++
local t = {
walls = {{x = 100, y = 100, z = 7}, {x = 100, y = 100, z = 7}, {x = 100, y = 100, z = 7}},
wall_id = 2134,
monster = 'rat',
wall_respawn_time = 5, --minutes
room = {
fromPos = {x = 100, y = 100, z = 7},
toPos = {x = 100, y = 100, z = 7}
}
}
function onKill(cid, target, lastHit)
if isMonster(target) then
if getCreatureName(target):lower() == t.monster then
if isInRange(getCreaturePosition(target), t.room.fromPos, t.room.toPos) then
for k = 1, #t.walls do
if getTileItemById(t.walls[k], t.wall_id) then
doRemoveItem(getTileItemById(t.walls[k], t.wall_id).uid)
addEvent(doCreateItem, t.wall_respawn_time*60, 1, t.wall_id, t.walls[k])
end
end
end
end
end
return TRUE
end
<movevent type="RemoveItem" itemid="xxxx" event="script" value="remove_wall.lua"/>
<event type="death" name="RemoveWall" event="script" value="remove_wall.lua"/>