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

Lua Script 7 days free vip help

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Lua:
function onLogin(cid)
local storage,days = (getPlayerAccountId(cid)+550),7
if getGlobalStorageValue(storage) <= 13550 then
setGlobalStorageValue(storage, 13550)
addVipDays(cid, days)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você recebeu "..days.." dias de VIP.Tenha um bom jogo!")
end
return true
end

CODE: ERRO ON CONSOLE
Code:
[14/04/2022 23:27:40] [Error - CreatureScript Interface]
[14/04/2022 23:27:40] data/creaturescripts/scripts/vipacc.lua:onLogin
[14/04/2022 23:27:40] Description:
[14/04/2022 23:27:40] data/creaturescripts/scripts/vipacc.lua:5: attempt to call global 'addVipDays' (a nil value)
[14/04/2022 23:27:40] stack traceback:
[14/04/2022 23:27:40]     data/creaturescripts/scripts/vipacc.lua:5: in function <data/creaturescripts/scripts/vipacc.lua:1>
 
Solution
Looking at his script I think he is using tfs 0.3.x - 0.4 @dewral

@samuel157
Firstly, follow this tutorial to add the vip, because I guess you don't have vip system yet... The best VIP system ever! [Action/Movevent/Globalevent] (https://otland.net/threads/the-best-vip-system-ever-action-movevent-globalevent.71638/)
Secondly change your script that you provided in your post to:

Lua:
function onLogin(cid)
local storagef = 15090 -- 15090 or any storage that IS NOT USED YET by any script
local daysf = 7
if getPlayerStorageValue(cid, storagef) < 1 then
    setPlayerStorageValue(cid, storagef, 2)
    doAddVipDays(cid, daysf)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você recebeu "..daysf.." dias de...
Says it right there buddy....
Code:
data/creaturescripts/scripts/vipacc.lua:5: attempt to call global 'addVipDays' (a nil value)
the function addVipDays doesn't exist anywhere.

As for the rest of the code...
Code:
local storage,days = (getPlayerAccountId(cid)+550),7
my nan has better logic than this
 
Im using this if that's help you

Lua:
local days = 30 --dias que da de vip

local vip = Action()
function vip.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:addVipDays(days)
        item:remove(1)
        player:remove() -- need kick player to add functions (outfit, mounts, and exp)
    else
        player:sendCancelMessage("You can't use this when you're in a fight and in protection zone.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
    return true
end


vip:id(2327) -- id vip scroll
vip:register()
 
Looking at his script I think he is using tfs 0.3.x - 0.4 @dewral

@samuel157
Firstly, follow this tutorial to add the vip, because I guess you don't have vip system yet... The best VIP system ever! [Action/Movevent/Globalevent] (https://otland.net/threads/the-best-vip-system-ever-action-movevent-globalevent.71638/)
Secondly change your script that you provided in your post to:

Lua:
function onLogin(cid)
local storagef = 15090 -- 15090 or any storage that IS NOT USED YET by any script
local daysf = 7
if getPlayerStorageValue(cid, storagef) < 1 then
    setPlayerStorageValue(cid, storagef, 2)
    doAddVipDays(cid, daysf)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você recebeu "..daysf.." dias de VIP.Tenha um bom jogo!")
end
return true
end


~~ Script untested btw
 
Solution
Back
Top