Yatozin
New Member
- Joined
- Jun 13, 2014
- Messages
- 49
- Reaction score
- 3
Lua:
-- Boss teleport spawn script by mdwilliams.
-- https://otland.net/threads/tfs-1-2-portal-created-on-monster-death.265567/#post-2567024
-- Converted to TFS 1.3 Revscriptsys by Evil Hero.
local teleportToPosition = Position(1000, 1000, 7)
local teleportCreatePosition = Position(2000, 2000, 7)
local bossName = "boss monster"
local killMessage = "You have killed Boss Monster! A teleport has been created but it will disappear in 5 minutes!"
-- Function that will remove the teleport after a given time
local function removeTeleport(position)
local teleportItem = Tile(position):getItemById(1387)
if teleportItem then
teleportItem:remove()
position:sendMagicEffect(CONST_ME_POFF)
end
end
local event = CreatureEvent("BossKill")
function event.onKill(creature, target)
if target:isPlayer() or target:getMaster() or target:getName():lower() ~= bossName then
return true
end
local position = target:getPosition()
position:sendMagicEffect(CONST_ME_TELEPORT)
local item = Game.createItem(1387, 1, teleportCreatePosition)
if item:isTeleport() then
item:setDestination(teleportToPosition)
end
target:say(killMessage, TALKTYPE_MONSTER_SAY, 0, 0, position)
-- Remove portal after 5 minutes
addEvent(removeTeleport, 5 * 60 * 1000, position)
return true
end
event:register()
local login = CreatureEvent("RegisterBossKill")
function login.onLogin(player)
player:registerEvent("BossKill")
return true
end
login:register()
[TFS 1.3] [Revscriptsys] Free Lua scripting service - Post your requests! Let's learn it together!
What is revscriptsys? Revscriptsys is a new way to register your scripts in an easy drag and drop way without the need to register it with xml. Basically you just place your .lua file into data/scripts/ or any subfolder according to your taste, except for monster files, they go into...
otland.net
For some reason the tp never goes away no errors or anything.