roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 206
Hi, i created this code, player use a spell and create a teleport below himself (teleport remove after 5s). [this script is ok]
all players entering teleport are taken to an area (teleport destination), in that area there is a teleport for the player to leave.
I need, if a player entered in teleport, to leave, he will be teleported to the place where the teleport was when he entered, how to do that?
spell.lua (all OK)
teleportBACK.lua [HERE I NEED HELP]
how can i make teleport back to POS, where the teleport created by spell was?
all players entering teleport are taken to an area (teleport destination), in that area there is a teleport for the player to leave.
I need, if a player entered in teleport, to leave, he will be teleported to the place where the teleport was when he entered, how to do that?
spell.lua (all OK)
LUA:
function tpCreate(position)
Game.createItem(1387, 1, position):setDestination(Position(1000, 1000, 7))
end
function tpRemove(position)
position:getTile():getItemById(9485):remove()
end
function onCastSpell(creature, variant)
tpCreate(creature:getPosition())
addEvent(tpRemove, 5000, creature:getPosition())
return combat:execute(creature, variant)
end
teleportBACK.lua [HERE I NEED HELP]
LUA:
function onStepIn(creature, item, position, fromPosition)
creature:teleportTo(????)
return true
end
how can i make teleport back to POS, where the teleport created by spell was?
Last edited: