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

Vip Teleport

Solution
try:
Lua:
local config = {
    teleportActionId = 44222
}

local vipEnter = MoveEvent('vipEnter')
function vipEnter.onStepIn(player, item, position, fromPosition)
    if player:getVipDays() == 0 then
        player:teleportTo(fromPosition)
        player:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You don't have vip.")
        return true
    end 
    return true
end
vipEnter:aid(config.teleportActionId)
vipEnter:register()
try:
Lua:
local config = {
    teleportActionId = 44222
}

local vipEnter = MoveEvent('vipEnter')
function vipEnter.onStepIn(player, item, position, fromPosition)
    if player:getVipDays() == 0 then
        player:teleportTo(fromPosition)
        player:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You don't have vip.")
        return true
    end 
    return true
end
vipEnter:aid(config.teleportActionId)
vipEnter:register()
 
Solution
Dude it worked! ur a fucking legend.
Btw, I cant get my exp to work, Do you have any idea?

function Player:eek:nGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
if self : isVip () then
exp = exp * 20 - 20 % exp
end

return exp
end
Post automatically merged:

try:
Lua:
local config = {
    teleportActionId = 44222
}

local vipEnter = MoveEvent('vipEnter')
function vipEnter.onStepIn(player, item, position, fromPosition)
    if player:getVipDays() == 0 then
        player:teleportTo(fromPosition)
        player:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You don't have vip.")
        return true
    end
    return true
end
vipEnter:aid(config.teleportActionId)
vipEnter:register()

It worked as it should, but in server it spamming

Lua script error: C:\Users\Mathias\Downloads\otservbr-global-develop\otservbr-global-develop\data\scripts\movements\VIP.lua:callback
...p\otservbr-global-develop\data\scripts\movements\VIP.lua:9: attempt to call method 'sendMagicEffect' (a nil value)
stack traceback:
[C]: in function 'sendMagicEffect'
...p\otservbr-global-develop\data\scripts\movements\VIP.lua:9: in function <...p\otservbr-global-develop\data\scripts\movements\VIP.lua:6>
 
Last edited:
Im not geting the extra exp
Try this
Lua:
function Player:onGainExperience(source, exp, rawExp)
    if not source or source:isPlayer() then
        if self:getVipDays() > 0 then
            exp = exp * 20 - 20 % exp
        end
    end
    return exp
end
 
Last edited:
Im not geting the extra exp

is onGainExperience enabled?

are there any errors?

is this supposed to give +20% or is the formula correct 🤔
Lua:
exp = exp * 20 - 20 % exp
if you need it to be +20% then use
Lua:
exp = exp * 1.2

EDIT
@Xikini
He might have copy pasted just a part of the whole function.
 
Have you worked out the issue with the exp gain? I seem to be in the same boat, does it have something to do with using exp stages perhaps?
 
Back
Top