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

Why is the numbervalue not updating?

I assign a variable to a number value like this

variable = value.Value

,however it doesn't change the Value of value when I change the variable in the script. How can I fix this?

2 answers

✓ Accepted answer

When you assign a variable to a property, the variable is simply assigned the value of that property, retaining no reference to the actual object. Because of this, the variable will not change when the object's property changes and will not update the object's property.

Make your variables equal to objects, then access the property, e.g.

local part = workspace.Part
part.Transparency = 1

this is an update to my last answer

while wait() do --I recently discovered that you can replace the "true" with "wait()" and use that wait as your time period :D
variable = Value.value
end

May I ask why people knocked my reputation down for a legitimate answer?

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