wafuboe
Member
- Joined
- Dec 24, 2010
- Messages
- 881
- Solutions
- 2
- Reaction score
- 22
Im using tfs 1.2
I got this teleport script when you kill a boss but i kill theboss but it doesnt work.
Script
Creaturescripts
Login
I got this teleport script when you kill a boss but i kill theboss but it doesnt work.
Script
Code:
local config = {
["ushuriel"] = {time = 60, toPos = Position(1178, 1144, 5), tpPos = Position(1120, 1119, 5)}
}
local function deleteTeleport(position)
local teleport = Tile(position):getItemById(1387)
if teleport then
teleport:remove()
position:sendMagicEffect(CONST_ME_POFF)
end
end
function onKill(creature, target)
local monster = config[target:getName():lower()]
if not monster or target:isPlayer() then
return true
end
local item = Game.createItem(1387, 1, monster.tpPos)
if item:isTeleport() then
item:setDestination(monster.toPos)
end
creature:say("You have " .. monster.time .. " seconds to enter the teleport!", TALKTYPE_MONSTER_SAY)
addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
return true
end
Creaturescripts
Code:
<event type="kill" name="CreateTeleport" script="tpboss.lua"/>
Login
Code:
registerCreatureEvent(cid, "UshurielCreateTeleport")