• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Teleport with storage destination [TFS 1.2]

Wanheda

New Member
Joined
Feb 17, 2016
Messages
44
Solutions
2
Reaction score
4
I need the help of someone who can make a script, where when stepping on the teleport, teleport to different destinations according to your storage, example:

If the player has storage 1111> teleport to destination1

Or if player has storage 2222> teleport to destination2.

Thanks.
 
Im no .lua master but this should work.

Lua:
function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    if player:getStorageValue(1111) > 1 then
        player:teleportTo(Position(500, 500, 7), false)      
    elseif player:getStorageValue(2222) > 2 then
        player:teleportTo(Position(1000, 1000, 7), false)          
    end
    return true
end
 
Back
Top