Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont this script anchor the puck to stop time and then add to the value?

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

1 comment

0

Are you constantly checking the time or are you only checking once

2 answers

✓ Accepted answer

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.

5 comments

0

another script works with it in their so

0

Maybe you put it in the wrong spot?

0

no idk why its not working

0

Well, idk either then.

0

ah I figured out out

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



This discussion is preserved as it was. New answers, comments, and votes are closed.