• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua End of Premium and Shovel.

tatiana

Sexy Girl
Joined
Mar 30, 2009
Messages
215
Reaction score
8
This one I want when premium is over, players of rook go to temple of rook and players of main go to thais.
LUA:
function onLogin(cid)
local temple = { x =32369, y = 32241, z = 7}
if isPremium(cid) == true then
if getPlayerStorageValue(cid,55855) ~= 1 then
setPlayerStorageValue(cid,55855,1)
end
else
if getPlayerStorageValue(cid,55855) == 1 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSendTextMessage(cid, 22, "Your Premium Time over!")
setPlayerStorageValue(cid, 55855, 0)
end
end
return true
end
And this one I want the players of rookguard can't use at sand to summon scarab, someone can do it for me?
LUA:
local OPENED_HOLE = {294, 383, 469, 470, 482, 482, 485, 489, 430}
local OPENED_TRAP = {462}
local DOWN_LADDER = {369, 370, 408, 409, 427, 428, 3135, 3136, 5545, 5763}
local ROPE_SPOT = {384, 418}
local allowed_items_inway = {2016, 2017, 2018, 2019, 2020, 2021, 1903, 1904, 1905}

function onUse(cid, item, frompos, item2, topos)
    newPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 0}
    groundItem = getThingfromPos(newPos)
   
    BlockItemPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 2}
    blockingItem = getThingfromPos(BlockItemPos)
    BlockItem1 = {x = topos.x, y = topos.y, z = topos.z, stackpos = 1}
    blockiItem1 = getThingfromPos(BlockItem1)
    if (isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then
        newPos.y = newPos.y + 1
        newPos.z = newPos.z - 1
        if blockingItem.itemid <= 0 or blockiItem1.itemid <= 0 or (isInArray(allowed_items_inway, blockingItem.itemid) == TRUE) then
        doTeleportThing(cid, newPos)
        end
    elseif (isInArray(OPENED_HOLE, groundItem.itemid) == TRUE or isInArray(OPENED_TRAP, groundItem.itemid) == TRUE or isInArray(DOWN_LADDER, groundItem.itemid) == TRUE) then
        newPos.y = newPos.y + 1
        downPos = {x = topos.x, y = topos.y, z = topos.z + 1, stackpos = 255}
        downItem = getThingfromPos(downPos)
        if (downItem.itemid > 0) then
            doTeleportThing(downItem.uid, newPos)
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    else
        return FALSE
    end
    return TRUE
end
 
For the first one, it appears to be nearly perfect already.
Just make sure you are setting the players TownID at some point. (such as first login, and when they are transferred to main)
LUA:
local config = {
    storageForOneTimeTeleport = 55855,
    rookgaardTownID = ???,
    thaisTownID = ???
}

function onLogin(cid)
    if isPremium(cid) == true then
        if getPlayerStorageValue(cid, config.storageForOneTimeTeleport) ~= 1 then
            setPlayerStorageValue(cid, config.storageForOneTimeTeleport, 1)
        end
        return true
    end
    if getPlayerStorageValue(cid, config.storageForOneTimeTeleport) == 1 then
        if getPlayerTown(cid) == config.rookgaardTownID then
            doTeleportThing(cid, getTownTemplePosition(config.rookgaardTownID))
        else
            doTeleportThing(cid, getTownTemplePosition(config.thaisTownID))
        end
        doPlayerSendTextMessage(cid, 22, "Your Premium Time over!")
    end
    return true
end

Second one, just add the same thing where it's required. (I don't see any sand/summon parts in the script. I assume it's another script which is responsible for this. (Light Shovel, possibly?))
Code:
if getPlayerTown(cid) == rookgaardTownID then
 
Last edited by a moderator:
Back
Top