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

Is there a shortcut for arithmetic operations in values?

Asked by
Tesouro 407 Moderation Voter
10 years ago

The title is messy, just made it look like a question. I will explain it now. Example: when you have a number value and you want to sum 1 to it, you'll do this:

value = value + 1

right? But most of my codes are not so simple and doing that will make them messy. Is there a shortcut to perform the same action? Like some languages have:

value += 1

1 answer

Log in to vote
1
Answered by
LostPast 253 Moderation Voter
10 years ago

1 value = value + 1

Is the only way but if you are adding multiple things you can do

1 value = value + (1+2+3+4)

Roblox's Lua isn't the most efficient programming languadge for numbers and arithmetics. Sorry!

0
Okay, thanks. Tesouro 407 — 10y
0
Im stalking your questions, just wanting to point out ROBLOX isnt the lang, its LUA BSIncorporated 640 — 9y
Ad

Answer this question