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

TFS 1.X+ help me interface error.

cocacola13

Member
Joined
Jan 18, 2019
Messages
179
Reaction score
12
Location
poland
Hello im have problem because I added a script to action and I get an error from the interface
can anyone help me?

error

Lua Script Error: [Test Interface]
data/actions/scripts/other/vip.lua
data/actions/scripts/other/vip.lua:4: attempt to perform arithmetic on a boolean valu e
stack traceback:
[C]: in function '__add'
data/actions/scripts/other/vip.lua:4: in main chunk
[C]: in function 'reload'
data/talkactions/scripts/reload.lua:73: in function <data/talkactions/scripts /reload.lua:56>
[Warning - Event::checkScript] Can not load script: scripts/other/vip.lua


Script
C++:
-- Config --
local days =
{
    [1] = {vipTime = (getPlayerStorageValue(cid, vipStatus)+ 30), vipItem = 5807 }, -- Bronze Goblet
    [2] = {vipTime = (getPlayerStorageValue(cid, vipStatus)+ 60), vipItem = 5806 }, -- Silver Goblet
    [3] = {vipTime = (getPlayerStorageValue(cid, vipStatus)+ 90), vipItem = 5805 } -- Golden Goblet
}
local vipStatus = 1234
--End Config --
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, vipStatus) == FALSE then
        if (item.itemid == days[1].vipItem) then
            doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 30 days.", TALKTYPE_ORANGE_1)
            doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
            setPlayerStorageValue(cid, vipStatus, days[1].vipTime)
            doRemoveItem(item.uid, 1)
        elseif (item.itemid == days[2].vipItem) then
            doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 60 days.", TALKTYPE_ORANGE_1)
            doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
            setPlayerStorageValue(cid, vipStatus, days[2].vipTime)
            doRemoveItem(item.uid, 1)
        elseif (item.itemid == days[3].vipItem) then
            doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 90 days.", TALKTYPE_ORANGE_1)
            doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
            setPlayerStorageValue(cid, vipStatus, days[3].vipTime)
            doRemoveItem(item.uid, 1)
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already a VIP Member.")
    end
    return TRUE
end
Post automatically merged:

Help? Please?
 
Last edited:
Clarify which exact version of tfs you use, if it's not the downgraded version of Nekiro then doSendAnimatedText has also to be excluded as it'll just throw more errors.
 
LUA:
local config = {
    [5807] = 30,
    [5806] = 60,
    [5805] = 90
}

local vipStatus = 1234

function onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getStorageValue(vipStatus) < 1 then
        local days = config[item.itemid]
        if days then
            Game.sendAnimatedText("VIP", player:getPosition(), TEXTCOLOR_RED)
            player:say("CONGRATULATIONS! You are now a VIP for ".. days .." days.", TALKTYPE_ORANGE_1)
            fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
            player:setStorageValue(vipStatus, player:getStorageValue(vipStatus) + days)
            item:remove()
        end
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are already a VIP Member.")
    end
    return true
end
 
you script is good, me is not working door. aff action interface error

[ERROR]
Lua Script Error: [Action Interface]
data/actions/scripts/vipdoor.lua:onUse
data/lib/custom/function.lua:3: attempt to call global 'getPlayerAccountId' (a nil value)
stack traceback:
[C]: in function 'getPlayerAccountId'
data/lib/custom/function.lua:3: in function 'getPlayerVipDays'
data/actions/scripts/vipdoor.lua:2: in function <data/actions/scripts/vipdoor.lua:1>

Script
function onUse(cid, item, frompos, item2, topos) if getPlayerVipDays(cid) >= 1 then pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,"Stand in front of the door.") return true end doTeleportThing(cid,pos) doSendMagicEffect(topos,12) else doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.') end return true end
 
Back
Top