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

How do I add a number values value by 1?

So, I am a intermediate builder and a pro scripter. I am trying to figure out how to add number values by 1. Something like this:

script.Parent.NumberValue.Value += 1

But then up comes an error from output, I don't know what I've done wrong. Can somebody please help?

2 comments

0

Could you show more of the code? Also , what is the error?

1

@RebornedSnoop Already answered.

1 answer

✓ Accepted answer

Augmented assignment isn't really a thing in Lua. You have to actually write it out in full:

script.Parent.NumberValue.Value = script.Parent.NumberValue.Value + 1

Lua is weird.

1 comment

1

Thanks dude!

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