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

How do you change a NumberValue?

Asked by
NecoBoss 194
9 years ago

After much blood, sweat, and tears, I have decided that I must resort to this site for answers. I have been trying to add to a numbervalue located in StarterGUI by use of a local script. However, my efforts have ended with absolutely no progress. Here is my code:

while true do
    wait(1)
    script.Parent.Value = script.Parent.Value + 1
end

I'm starting to think that values can't be changed by local scripts and FE is not enabled.

0
what type of script is this in koolkid8099 705 — 9y

3 answers

Log in to vote
1
Answered by 9 years ago

Maybe a :WaitForChild() and you can!

local val = script.Parent:WaitForChild("Value")

while true do

wait(3)

val.Value = val.Value + 1

end

0
If that didn't help try - while wait(3) do Asperanator -4 — 9y
0
It's not a problem with the loop. It works with a normal script in the workspace but not in StarterGui NecoBoss 194 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
while wait(1) do

script.Parent.ValueNameHere.Value + 1

end

Put the value inside the script and change ValueNameHere to the name of the value.

0
If that doesn't work then try adding game.Players.PlayerAdded:connect(function(player) before while wait(1) do. silverminer226 4 — 9y
Log in to vote
0
Answered by
NecoBoss 194
9 years ago

AHA!! I solved it myself. Apparently the script doesn't work in StarterGui but instead works in PlayerGui. Thanks for the help though guys!

Answer this question