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

Why does this not change the text?

StageNo = game.ServerStorage.StageNo.Value

while true do 
	script.Parent.Text = StageNo
	wait(0.01)
end

so im trying to make it so that the text changes to 1 when i hit something i printed out the value when i hit it and it come out with one(which is good) however, it doesnt afect the text value. Why? How do i fix it?

1 answer

✓ Accepted answer

This is quite a common mistake, slightly hard to explain but quite simple: target the Value object, not the .Value itself.

What I mean by this is instead of using Value.Value, you use Value and change the .Value property.

StageNo = game.ServerStorage.StageNo

while true do
   script.Parent.Text = StageNo.Value
   wait()
end

To put this into simplicity, when setting a variable to a property, it only sets itself to the property and doesn't affect it. In order to change the property you need to target the object itself, then add your property you want to change. Kinda hard to wrap your head around first but once you understand it it's easy.

1 comment

0

I'll accept the answer, but i already fixed it with a global variable i.e. _G.StageNo

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