• 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!

Rookgaardians been teleported to main when P.A. is over.

Curb

Active Member
Joined
Sep 7, 2014
Messages
82
Solutions
5
Reaction score
34
Hello guys,

Well I'm using Nostalrius and this is part of my login.lua:
Lua:
    -- Premium system
    if player:isPremium() then
        player:setStorageValue(43434, 1)
    elseif player:getStorageValue(43434) == 1 then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
    end
Unfortunately players from Rookgaard are been pushed to Thais when their premium account is over.
Does anyone knows what can I change?
 
Solution
Try this one, Change rook x-y-z
Lua:
    -- Premium system
    if player:isPremium() then
        player:setStorageValue(43434, 1)
    elseif player:getStorageValue(43434) == 1 and isInArray({1, 2, 3, 4, 5, 6, 7, 8}, player:getVocation():getId()) then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
    elseif player:getStorageValue(43434) == 1 and player:getVocation():getId() == 0 then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = replacewithrookgaardX, y = replacewithrookgaardY, z = replacewithrookgaardZ})
        player:setTown(Town("Rookgaard"))
    end
So what you exactly want to do? you don't want them to get teleported to Thais?
 
Then just remove those 2 lines which teleports them to Thais.
Lua:
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
 
But then people without premium account will stay in premium areas. No?

Let me be more clear.

Premium account is over
Player have vocation go to Thais
Player does not have vocation go to Rookgaard
 
This should teleport players with vocations from 1 to 8 to Thais and let the no vocation players in rookgaard.
Lua:
    -- Premium system
    if player:isPremium() then
        player:setStorageValue(43434, 1)
        local voc = player:getVocation():getId()
    elseif player:getStorageValue(43434) == 1 and (isInArray({1,8}, voc)) then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
    end
 
Try this one, Change rook x-y-z
Lua:
    -- Premium system
    if player:isPremium() then
        player:setStorageValue(43434, 1)
    elseif player:getStorageValue(43434) == 1 and isInArray({1, 2, 3, 4, 5, 6, 7, 8}, player:getVocation():getId()) then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
    elseif player:getStorageValue(43434) == 1 and player:getVocation():getId() == 0 then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = replacewithrookgaardX, y = replacewithrookgaardY, z = replacewithrookgaardZ})
        player:setTown(Town("Rookgaard"))
    end
 
Last edited:
Solution
Worked! The Rookgaard part is not teleporting to Rook temple, but that is fine for me already. I kept it like that!

Lua:
    -- Premium system
    if player:isPremium() then
        player:setStorageValue(43434, 1)
    elseif player:getStorageValue(43434) == 1 and isInArray({1, 2, 3, 4, 5, 6, 7, 8}, player:getVocation():getId()) then
        player:setStorageValue(43434, 0)
        player:teleportTo({x = 32369, y = 32241, z = 7})
        player:setTown(Town("Thais"))
    end

Thank you so much!
 
Back
Top