• Sign up for TFS Icon Competition! The prize includes Otland Premium time and a medal, as well as obviously taking part in TFS history.
  • 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!

SNOWBALL WARR TFS 1.2

Ichito123

New Member
Joined
Nov 25, 2013
Messages
32
Reaction score
0
Hello everyone i have problem with that ;/
Lua:
function onSay(player, words, param)
    if not isInArena(player) then
        return false
    end

    if param == "shoot" then
        if player:getExhaustion(8002) > 1 then
            return true
        end

        if not SnowBall_Configurations.Ammo_Configurations.Ammo_Infinity then
            if player:getStorageValue(8003) > 0 then
                player:setStorageValue(8003, player:getStorageValue(8003) - 1)
                player:sendCancelMessage("Pozostalo ".. player:getStorageValue(8003) .." sniezek.")
            else
                player:sendCancelMessage("Nie masz juz sniezek.")
                return true
            end
        end

        player:setExhaustion(8002, SnowBall_Configurations.Ammo_Configurations.Ammo_Exhaust)
        Event_sendSnowBall(player:getId(), player:getPosition(), SnowBall_Configurations.Ammo_Configurations.Ammo_Distance, player:getDirection())
        return false
    elseif param == "info" then
        local str = "     ## -> Player Infos <- ##\n\nPkt: ".. player:getStorageValue(8004) .."\nSniezki: ".. player:getStorageValue(8003)

        str = str .. "\n\n          ## -> Ranking <- ##\n\n"
        for i = 1, 5 do
            if CACHE_GAMEPLAYERS[i] then
                str  = str .. i .. ". " .. Player(CACHE_GAMEPLAYERS[i]):getName() .."\n"
            end
        end
        for pos, players in ipairs(CACHE_GAMEPLAYERS) do
            if player:getId() == players then
                str = str .. "My Ranking Pos: " .. pos
            end
        end

        player:showTextDialog(2111, str)
        return false
    end
end


error.jpg


Can you help me please ? How i can fix it ?
 
Solution
Let me know if it throws any errors, if you are missing libs, you might be missing configuration as well.

Lua:
function onSay(player, words, param)
    if not isInArena(player) then
        return false
    end
    if param == "shoot" then
        if player:getStorageValue(8002) > os.time() then
            return true
        end
        if not SnowBall_Configurations.Ammo_Configurations.Ammo_Infinity then
            if player:getStorageValue(8003) > 0 then
                player:setStorageValue(8003, player:getStorageValue(8003) - 1)
                player:sendCancelMessage("Pozostalo ".. player:getStorageValue(8003) .." sniezek.")
            else
                player:sendCancelMessage("Nie masz juz sniezek.")...

4Nathu4

valoria.online
Premium User
Joined
Oct 27, 2009
Messages
212
Solutions
6
Reaction score
107
GitHub
4mrcn4
Hello everyone i have problem with that ;/
Lua:
function onSay(player, words, param)
    if not isInArena(player) then
        return false
    end

    if param == "shoot" then
        if player:getExhaustion(8002) > 1 then
            return true
        end

        if not SnowBall_Configurations.Ammo_Configurations.Ammo_Infinity then
            if player:getStorageValue(8003) > 0 then
                player:setStorageValue(8003, player:getStorageValue(8003) - 1)
                player:sendCancelMessage("Pozostalo ".. player:getStorageValue(8003) .." sniezek.")
            else
                player:sendCancelMessage("Nie masz juz sniezek.")
                return true
            end
        end

        player:setExhaustion(8002, SnowBall_Configurations.Ammo_Configurations.Ammo_Exhaust)
        Event_sendSnowBall(player:getId(), player:getPosition(), SnowBall_Configurations.Ammo_Configurations.Ammo_Distance, player:getDirection())
        return false
    elseif param == "info" then
        local str = "     ## -> Player Infos <- ##\n\nPkt: ".. player:getStorageValue(8004) .."\nSniezki: ".. player:getStorageValue(8003)

        str = str .. "\n\n          ## -> Ranking <- ##\n\n"
        for i = 1, 5 do
            if CACHE_GAMEPLAYERS[i] then
                str  = str .. i .. ". " .. Player(CACHE_GAMEPLAYERS[i]):getName() .."\n"
            end
        end
        for pos, players in ipairs(CACHE_GAMEPLAYERS) do
            if player:getId() == players then
                str = str .. "My Ranking Pos: " .. pos
            end
        end

        player:showTextDialog(2111, str)
        return false
    end
end


View attachment 50431


Can you help me please ? How i can fix it ?
your engine is attempting to call method getExhaustion, but it's not finding any.
You are either missing the function in your scope or missing some libs in general.

Let me know what logic (would exhaustion be snowball exclusive, or would I consider the spells as well) would stand behind it, and ill write it for you.
 

4Nathu4

valoria.online
Premium User
Joined
Oct 27, 2009
Messages
212
Solutions
6
Reaction score
107
GitHub
4mrcn4
Let me know if it throws any errors, if you are missing libs, you might be missing configuration as well.

Lua:
function onSay(player, words, param)
    if not isInArena(player) then
        return false
    end
    if param == "shoot" then
        if player:getStorageValue(8002) > os.time() then
            return true
        end
        if not SnowBall_Configurations.Ammo_Configurations.Ammo_Infinity then
            if player:getStorageValue(8003) > 0 then
                player:setStorageValue(8003, player:getStorageValue(8003) - 1)
                player:sendCancelMessage("Pozostalo ".. player:getStorageValue(8003) .." sniezek.")
            else
                player:sendCancelMessage("Nie masz juz sniezek.")
                return true
            end
        end
        player:setStorageValue(8002, SnowBall_Configurations.Ammo_Configurations.Ammo_Exhaust + os.time())
        Event_sendSnowBall(player:getId(), player:getPosition(), SnowBall_Configurations.Ammo_Configurations.Ammo_Distance, player:getDirection())
        return false
    elseif param == "info" then
        local str = "     ## -> Player Infos <- ##\n\nPkt: ".. player:getStorageValue(8004) .."\nSniezki: ".. player:getStorageValue(8003)
        str = str .. "\n\n          ## -> Ranking <- ##\n\n"
        for i = 1, 5 do
            if CACHE_GAMEPLAYERS[i] then
                str  = str .. i .. ". " .. Player(CACHE_GAMEPLAYERS[i]):getName() .."\n"
            end
        end
        for pos, players in ipairs(CACHE_GAMEPLAYERS) do
            if player:getId() == players then
                str = str .. "My Ranking Pos: " .. pos
            end
        end
        player:showTextDialog(2111, str)
        return false
    end
end
 
Last edited:
Solution
Top