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

Why this doesn't work?

Asked by
Kroww 10
10 years ago

I still wonder why this doesn't work:

p=Instance.new("NumberValue",workspace) 
p.Value=1
 e=p.Value 
e=e+1 
print(e,p.Value)
-->2, 1

1 answer

Log in to vote
2
Answered by 10 years ago

You are assigning a new variable a value equal to p.Value, and not assigning the Value a tag. Remove the .Value and add it to your tags when applicable.

tag = script.Parent.NumberValue

tag.Value = tag.Value + 1
Ad

Answer this question