I tried to make it so the puck would anchor to stop the time and then it adds 10 into the miniutes value, but its not working.
if game.ReplicatedStorage.ClockValues.minutes.Value == 0 and game.ReplicatedStorage.ClockValues.seconds.Value == 1 then game.workspace.Puck.Anchored = true game.ReplicatedStorage.ClockValues.minutes.Value = game.ReplicatedStorage.ClockValues.minutes.Value +10 end
I think the problem is that ServerScript
's (assuming you're using one) can't edit things in ReplicatedStorage
. They can only access them. Try moving ClockValues
to ServerStorage
. Also, the if
statement will just run through once and end the script since the ClockValues are probably not equal to 1. Try using a while true do
loop. And lua is case sensitive, so you should use game.Workspace
.
Maybe this will work Add a intvalue
while true do wait(1) local rep = game:GetService("ReplicatedStorage").ClockValues.minutes game.workspace.Puck.Anchored = true rep.Value = game.ReplicatedStorage.ClockValues.minutes.Value +10 end