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

what does it mean when theres a ", " in a variable?

Asked by 5 years ago

for example local noob = Guest, Poop

I don't get what this means I just don't get it

3
They assign multiple variables in one line e.g. local one, two = 1, 2. That works. Though in your example if it's multiple values and only one variable, additional results are discarded, so "Poop" is discarded, and "noob" is assigned to "Guest". User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Your example, as mentioned by @incapaz in his comment, would not work. The variable "noob" would be assigned to "Guest" and not "Poop." Here is what would work:

local noob, bacon = "Guest", "Poop"

When defining variables with the comma, the amount of variables must be equal to the number of values assigned or else the script would not function properly.

Ad

Answer this question