Hello,
I'm racking my brain trying to do this, but it should actually be simple:
I created a Global event that spawns an NPC that teleports you, and set your Town to 3, and in that same event a Timer for the NPC to "go away".
So far so good, but I would like that after the timer in which the NPC is removed, all online players would be teleported to a position outside the event, this within the function created in "addEvent", so i trying like this:
Despite the ByeCaptain event running, I can't get all players to teleport, so I need some help with that. Ty
I'm racking my brain trying to do this, but it should actually be simple:
I created a Global event that spawns an NPC that teleports you, and set your Town to 3, and in that same event a Timer for the NPC to "go away".
Lua:
local npc_name = "Captain Barry" -- npc name
function onThink(interval)
Game.createNpc(npc_name, Position(297, 270, 6), false, true)
addEvent(ByeNPC, 60000)
return true
end
So far so good, but I would like that after the timer in which the NPC is removed, all online players would be teleported to a position outside the event, this within the function created in "addEvent", so i trying like this:
Lua:
function ByeCaptain()
broadcastMessage("[SHIPMENT] Captain Barry come out!")
doRemoveCreature(npc_name)
for index, creature in ipairs(getPlayersOnline()) do
doTeleportThing(creature, 297, 272, 6)
end
return true
end
Despite the ByeCaptain event running, I can't get all players to teleport, so I need some help with that. Ty