Ok so the Payday script works (Thanks Goulstem for getting it to work) but it adds money every second whether then every whatever second it's at example 180 seconds. Also how can I show mins, hours and secs?
local time = 180 while wait(1) do time = time - 1 if (time <= 0) then time = 180 end for i,v in pairs(game.Players:GetPlayers()) do --different source directory local plr = game.ServerScriptService.Players:FindFirstChild(v.Name) if plr then --edit-- local gui = v.PlayerGui:FindFirstChild('PaydayGui') --edit-- local creds = plr.Tickets if gui then gui.Label.Text = 'Next payday in '..time..' seconds' end if v:IsInGroup(782018) then creds.Value = creds.Value + 50 elseif v:IsInGroup(234706) then creds.Value = creds.Value + 30 end creds.Value = creds.Value + 50 end end end
To make it so it only awards you every x amount of seconds, you need to put the code inside your conditional on line 5
. This way, it will count down and only award if the timer is at 0, then reset.
And sorry, i'm not going to answer about how to convert it to minutes / hours because that's not constructive on your part if I just do it for you.
local time = 180 --Make a function to award. function awardPlayers() for i,v in pairs(game.Players:GetPlayers()) do local plr = game.ServerScriptService.Players:FindFirstChild(v.Name) if plr then local creds = plr.Tickets if v:IsInGroup(782018) then creds.Value = creds.Value + 50 elseif v:IsInGroup(234706) then creds.Value = creds.Value + 30 end creds.Value = creds.Value + 50 end end end --Make a function to update the guis function updateGuis() --Get all players for i,v in pairs(game.Players:GetPlayers()) do --Get gui local gui = v.PlayerGui:FindFirstChild('PaydayGui') --Make sure gui is there if gui then --Update it gui.Label.Text = 'Next payday in '..time..' seconds.' end end end while wait(1) do time = time - 1 --Update the guis updateGuis() if time <= 0 then time = 180 --Award the players INSIDE the conditional. awardPlayers() end end