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

Script Premium Bridge Rook (avesta)

For those wondering, I did a quick teamviewer session.

Map was using 2 uniqueID's and 2 actionID's for the bridge tiles.

Swapped for Only 2 ActionID's.

Quick test along with a minor adjustment to the local variable n, to make the whole script cohesive.

Lua:
function onStepIn(cid, item, topos, frompos)
   if getPlayerPremiumDays(cid) == 0 then
       local n = {x = topos.x + 3, y = topos.y, z = topos.z}
       doRelocate(topos, n)
       doSendMagicEffect(n, 12)
   end
   return true
end

function onAddItem(item, tile, position)
   local n = {x = topos.x + 3, y = topos.y, z = topos.z}
   return doRelocate(position, n), doSendMagicEffect(n, 12)
end

I would personally change the doRelocate's to doTeleportThing's, but otherwise it's fully functional.
 
Guys, I'm having a problem. Only paccs pass on my bridge, but when a creature like a chicken or a cat tries to pass, I get an error in the distro.

premium.lua
Lua:
function onStepIn(cid, item, pos)
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
    if isPremium(cid) then
        doTransformItem(item.uid, 447)
    else
        doTeleportThing(cid, niema)
        doSendMagicEffect(getCreaturePosition(cid), 14)
        doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
    end
end

function onStepOut(cid, item, pos)
    if item.itemid == 425 then
        doTransformItem(item.uid, 446)
    end
end

movements.xml
XML:
<movevent type="StepIn" uniqueid="8800" event="script" value="premium.lua"/>

ERRO:
[17/02/2021 09:41:30] [Error - MoveEvents Interface]
[17/02/2021 09:41:30] data/movements/scripts/premium2.lua:eek:nStepIn
[17/02/2021 09:41:30] Description:
[17/02/2021 09:41:30] (luaDoPlayerSendTextMessage) Player not found
 
Guys, I'm having a problem. Only paccs pass on my bridge, but when a creature like a chicken or a cat tries to pass, I get an error in the distro.

premium.lua
Lua:
function onStepIn(cid, item, pos)
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
    if isPremium(cid) then
        doTransformItem(item.uid, 447)
    else
        doTeleportThing(cid, niema)
        doSendMagicEffect(getCreaturePosition(cid), 14)
        doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
    end
end

function onStepOut(cid, item, pos)
    if item.itemid == 425 then
        doTransformItem(item.uid, 446)
    end
end

movements.xml
XML:
<movevent type="StepIn" uniqueid="8800" event="script" value="premium.lua"/>

ERRO:
[17/02/2021 09:41:30] [Error - MoveEvents Interface]
[17/02/2021 09:41:30] data/movements/scripts/premium2.lua:eek:nStepIn
[17/02/2021 09:41:30] Description:
[17/02/2021 09:41:30] (luaDoPlayerSendTextMessage) Player not found

Lua:
local failPosition = Position(X, Y, Z)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:isPremium() then
        return true
    end

    failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:teleportTo(failPosition)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE ,  "You need Premium to access.")
    return true
end

Code:
    <movevent event="StepIn" actionid="XXX" script="XXX.lua"/>
 
Last edited:
Lua:
local failPosition = Position(X, X, X)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:isPremium() then
        return true
    end

    failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:teleportTo(failPosition)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE ,  "You need Premium to access.")
    return true
end

Code:
    <movevent event="StepIn" actionid="XXX" script="XXX.lua"/>
I had this error

[17/02/2021 12:01:39] [Error - MoveEvents Interface]
[17/02/2021 12:01:39] data/movements/scripts/premium.lua
[17/02/2021 12:01:39] Description:
[17/02/2021 12:01:39] data/movements/scripts/premium.lua:1: attempt to call global 'Position' (a nil value)
[17/02/2021 12:01:39] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/premium.lua)
Post automatically merged:

Sorry, I gess is not the same tfs. Ive some bizarre erro with your script. Guys, can u help me in Rook?
 
Last edited:
I had this error

[17/02/2021 12:01:39] [Error - MoveEvents Interface]
[17/02/2021 12:01:39] data/movements/scripts/premium.lua
[17/02/2021 12:01:39] Description:
[17/02/2021 12:01:39] data/movements/scripts/premium.lua:1: attempt to call global 'Position' (a nil value)
[17/02/2021 12:01:39] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/premium.lua)
Post automatically merged:

Sorry, I gess is not the same tfs. Ive some bizarre erro with your script. Guys, can u help me in Rook?
Lua:
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)

function onStepIn(cid, item, pos)
    if not isPlayer(cid) or isPremium(cid) then
        doTransformItem(item.uid, 447)
    else
        doTeleportThing(cid, niema)
        doSendMagicEffect(getCreaturePosition(cid), 14)
        doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
    end
end

function onStepOut(cid, item, pos)
    if item.itemid == 425 then
        doTransformItem(item.uid, 446)
    end
end
 
Lua:
function onStepIn(cid, item, pos)
    if not isPlayer(cid) then
        return true
    end
    local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
    if isPremium(cid) then
        doTransformItem(item.uid, 447)
    else
        doTeleportThing(cid, niema)
        doSendMagicEffect(getCreaturePosition(cid), 14)
        doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
    end
end

function onStepOut(cid, item, pos)
    if item.itemid == 425 then
        doTransformItem(item.uid, 446)
    end
end
 
Back
Top