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

Does Roblox Lua have something other scripts have?

so I haven't really did anything because roblox studio crashes on me. So I was thinking if you can do variable += 1 like in a script

x = 0

while true do
	x += 1
end

instead of

for x = 0, ? do
	print('idk")
end

1 comment

0

Note that "Roblox Lua" is not its own language; rather Lua with disabled libraries and some modified functions + Roblox API

1 answer

✓ Accepted answer

No += increment is not possible, neither is ++

you will have to do x = x + 1;

As for your second example, I don't know what language that is from. but the ? by itself holds no value in Lua.

I recommend you take a look at syntax of Lua.

Lua Syntax

2 comments

0

+= is an increment exclusive to Python 2

1

MANY languages support x += as a shortcut to x = x +. It's odd that you'd pick specifically Python 2, when Python 3 also supports the feature.

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