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

What do the two values mean? Is it a measurement of studs?

Asked by 5 years ago

local xPosition = math.random(-64,64)

What exactly is the measurement that these values use?

(-64,64) Does that mean studs? What is the measurement?

1 answer

Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

It's simply a number.

You never gave context on what xPosition is used for, but I'm assuming it is for the X component of a part's position.

math.random(-64, 64) will give a single number between -64 and 64, so you are setting the variable to be that random number.

If you do choose to set that number as the X component for the position, then yes, the part's X component will be that many studs along the x-axis, 0 being the origin.

Hope this helps! :)

Ad

Answer this question