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:

1p=Instance.new("NumberValue",workspace)
2p.Value=1
3 e=p.Value
4e=e+1
5print(e,p.Value)
6-->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.

1tag = script.Parent.NumberValue
2 
3tag.Value = tag.Value + 1
Ad

Answer this question