So im making a game like work at a pizza place, the mainline of it is that you choose your job and then you work. the more things you get done the more money you get. When the serverTime is at a certain amount your paycheck shows up.
My problem:
I cant figure out the script for my ServerTime to go up... I made an intvalue in repstorage so yea.
I tried putting a script in server script storage but this does not work, the script was
local ServerTime = game.ReplicatedStorage.IntValue
While 100 == 100 do
wait(1)
ServerTime.Value = ServerTime.Value + 1
this should make it give me 1 servertime each second, Right?
my next script was my gui script, i put it inside the button (claimButton) this was it
local frame = game.StarterGui.MyScreenGui.Frame
local ServerTime = game.ReplicatedStorage.IntValue
local AmountForClaim = game.ReplicatedStorage.AmountPerClaim
local player = game.Players.LocalPlayer
local mouse = player:GetMouse
local Cash = player.leaderstats.Cash
while 100 == 100 do
if ServerTime.Value == 10 then
if frame.Visible == false then
frame.Visible = true
ServerTime.Value = 0
script.Parent.MouseButton1Click:Connect(function()
player.Cash.Value = player.Cash.Value + AmountForClaim
if frame.Visible == true then
wait()
frame.Visible = false
But it does not work ;( what can I do to fix this?

5 comments
lemme check over it real quick
This helped a lot, thank you. this will defenitely help me make my game!
actually, Im not too sure why this isnt working...
You can change the wait time for easier testing.
Is it printing anything when it doesn't work? I would like to know, because this script should be correct.