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

Why is the numbervalue not updating?

Asked by 9 years ago

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

Log in to vote
3
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

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
Ad
Log in to vote
1
Answered by 9 years ago

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?

Answer this question