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

Game.setStorageValue question

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi folks!

Can someone take some doubts that I have about Game.setStorageValue?
  1. While the server is online, if I do not set to 0, it will permanace?
  2. If the server restarts the storage will still continue?
Thanks.
 
Global storage isn't persistent, although you could just create another table in the database to make them as persistent as player storage.
 
Global storage isn't persistent, although you could just create another table in the database to make them as persistent as player storage.

That way is not what I want.
I want create a system when the server reachs X players online will start a raid, and I was thinking in make it with game.setStorageValue to check, to avoid make 43783476 raids.

What do you think?
 
That way is not what I want.
I want create a system when the server reachs X players online will start a raid, and I was thinking in make it with game.setStorageValue to check, to avoid make 43783476 raids.

What do you think?
I am thinking I don't care what you want... I answered your initial question :)
 
I'm guessing you would want it to look like this.. 2 scripts.
(not actual scripts.. I don't work with 1.x)
(although Codex said the storages aren't persistent.. so onStart script might not be needed.)
Code:
function onStart(blah blah)
    Game.setStorageValue(45001, 0)
    return true
end
Code:
function onThink(blah blah)
    if Game.getStorageValue(45001) < 1 then
        -- count online players function
        if players_online >= 50 then
            game.execute.raid
            Game.setStorageValue(45001, 1)
        end
    end
    return true
end
 
Back
Top