Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago

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
0
Are you constantly checking the time or are you only checking once thatwalmartman 404 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
another script works with it in their so KronxGoat 50 — 4y
0
Maybe you put it in the wrong spot? youtubemasterWOW 2741 — 4y
0
no idk why its not working KronxGoat 50 — 4y
0
Well, idk either then. youtubemasterWOW 2741 — 4y
0
ah I figured out out KronxGoat 50 — 4y
Ad
Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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



Answer this question