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

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


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

Code:
<moveevent event="stepin" actionid="200" script="premium_bridge.lua"/>

<moveevent event="AddItem" tileitem="1" actionid="200" script="premium_bridge.lua" />
 
Last edited:
Line 2 returns function doRelocate(pos1, pos2) if premiumDays == 0, else it will just return false or nothing.
Line 6 is if someone adds an item to the tile, it will be teleported back. No need for the second script, but they have it like that in the Cipsoft files and I assume out of nowhere that you are going for the similarity
 
Lua:
function onStepIn(cid, item, pos)

    if isPremium(cid) == false then
        pos.x = pos.x + 3
        doTeleportThing(cid, pos)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
    end
 
    return true
end
Last time I checked Avestas lua-functions (unedited by someone like yourself) only returns integers. So, isPremium(cid) == true should then be isPremium(cid) == 1 to work as expected

Also: updated the scripts, forgot the important magicial effect
 
Last edited:
this?
Lua:
function onStepIn(cid, item, topos, x:32061,y:32192 z:7)
    local n = topos.x + 3
    return getPlayerPremiumDays(cid) == 0 and doRelocate(topos, n), doSendMagicEffect(n, 12)
end

function onAddItem(item, tile, x:32061,y:32192 z:7)
    local n = position.x + 3
    return doRelocate(position, n), doSendMagicEffect(n, 12)
end
 
No, like I wrote it. Just add whatever actionid you want to the tiles, then declare that actionid in movement.xml, also like I wrote
 
If i pass in tile now i got this error in console

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/rookgaard/premium_bridge.lua.:eek:nStepIn

attempt to index a number value
stack traceback:
[C]: in function 'doSendMagicEffect'
data/movements/scripts/rookgaard/premium_bridge.lua.:3: in function <data/m
ovements/scripts/rookgaard/premium_bridge.lua.:1>
 
-.^ I am too blind to see what it is. Use this then, easier to understand as well:
Lua:
function onStepIn(cid, item, topos, frompos)
    if getPlayerPremiumDays(cid) == 0 then
        local n = topos.x + 3
        doRelocate(topos, n)
        doSendMagicEffect(n, 12)
    end
    return true
end
Are you sure your local n is sufficient for a position?
Normally I'd do my local like this..
Lua:
local n = {x = topos.x + 3, y = topos.y, z = topos.z}
 
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 = position.x + 3
    return doRelocate(position, n), doSendMagicEffect(n, 12)
end


i'm using this script, but not work with player... (i'm testing with player free acc logic)
 
try changing topos to position, and change frompos to fromPosition, and see if that works.

Like this :
Code:
function onStepIn(cid, item, position, fromPosition)
    if getPlayerPremiumDays(cid) == 0 then
        local n = {x = position.x + 3, y = position.y, z = position.z}
       doRelocate(position, n)
        doSendMagicEffect(n, 12)
    end
    return true
end


function onAddItem(item, tile, position)
    local n = position.x + 3
    return doRelocate(position, n), doSendMagicEffect(n, 12)
end
[/LIST]
 
Don't work :/

Is it possible to have another name of "Premium status" in the server? Idk why do not work
Do you have the source files?
check luascript.cpp for 'premium' or 'prem' and find out if there is a similar function for getPlayerPremiumDays(cid)
 
Back
Top