[SOLVED] Create System

Hello,

i want to create a system where every like 10 secounds the value of the player goes 1 int down. Like ply has 100 Water and after 10 secounds the ply has 99 Water. Could someone help me with this? Like a quick template or what i should use for it?

Here’s what I would do:

timer.Create("some_unique_name", 10, 0, function()

    local players = player.GetAll()

    for i = 1, #players do

        local ply = players[i]

        ply.yourVar = (ply.yourVar or 0) - 1

    end

end)

This update is done for all players at the same time but you can also do it individually with PlayerInitialSpawn