• 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 Talkactions: Save Error

Besegnar

Raz Server 7.6
Joined
Dec 21, 2009
Messages
96
Reaction score
0
Hello, I've abit of a problem.. when I try to /save on my 10.76 server this error shows up:

kdl75e.png


This is my save.lua:
Code:
local savingEvent = 0

function onSay(player, words, param)
    if player:getGroup():getAccess() then
        if isNumber(param) then
            stopEvent(savingEvent)
            save(tonumber(param) * 60 * 1000)
        else
            saveServer()
        end
    end
end

function save(delay)
    saveServer()
    if delay > 0 then
        savingEvent = addEvent(save, delay, delay)
    end
end
 
Hello Besegnar, it seems like the function isNumber cannot be retrieved from anywhere else, or if it's a variable, it's not defined.
 
just replace
Code:
if isNumber(param) then
with
Code:
if tonumber(param) then
I believe if it can't be converted to a number it will return either false or nil, which will take it to the else statement instead.
 
Back
Top