wafuboe
Member
- Joined
- Dec 24, 2010
- Messages
- 881
- Solutions
- 2
- Reaction score
- 22
Hello Otland!
I have this script im using TFS 1.3 supposedly the script works like there are different teleports in lets say 4 cities that teleport you to a lobby with teleports and a Single Teleport will take you back depending the teleport you use in which city.
so i use actionid 1001 for the teleport to send to the lobby for X city and single teleport with actionid 1000 in the lobby to take you back to the temple you came from.\
But it doesnt work no error on console, am i doing things right?
TY!
heres the script
i put this on movement.xml
I have this script im using TFS 1.3 supposedly the script works like there are different teleports in lets say 4 cities that teleport you to a lobby with teleports and a Single Teleport will take you back depending the teleport you use in which city.
so i use actionid 1001 for the teleport to send to the lobby for X city and single teleport with actionid 1000 in the lobby to take you back to the temple you came from.\
But it doesnt work no error on console, am i doing things right?
TY!
heres the script
Code:
local teleports = {
[1001] = {pos = {x = 1093, y = 747, z = 13}, value = 1},
[1002] = {pos = {x = 1000, y = 1000, z = 7}, value = 2},
[1003] = {pos = {x = 1000, y = 1000, z = 7}, value = 3}
}
local temples = {
[1] = {x = 433, y = 504, z = 7}, --Storage value 1 with bring them to this temple
[2] = {x = 1000, y = 1000, z = 7}, -- Storage value 2 will bring them to this one
[3] = {x = 1000, y = 1000, z = 7} -- Storage value 3 will bring them to this one
}
local storage = 16000
local aid = 1000
local portalId = 1367
function onStepIn(creature, item, position, fromPosition)
if item.itemid ~= portalId then return true end
if not creature:isPlayer() then return true end
local TELEPORT = teleports[item:getActionId()]
if not TELEPORT then
if item:getActionId() == 1000 then
local TEMPLE = temples[creature:getStorageValue(storage)]
if not TEMPLE then return true end
creature:teleportTo(TEMPLE)
Position(creature:getPosition()):sendMagicEffect(CONST_ME_TELEPORT)
end
else
creature:teleportTo(TELEPORT.pos)
creature:setStorageValue(storage, TELEPORT.value)
Position(creature:getPosition()):sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end
i put this on movement.xml
Code:
<movevent event="StepIn" fromaid="1000" toaid="1009" script="tplobby.lua" />