Is this possible?

Is it possible to just get the decimal values of a position. Like, let’s say a part has a y position of 45.5, can I just get rid of the 45 and take the .5? If so, how?

You could do something like:

number = string.match("5.45", "%.%d+")
1 Like

Didn’t get a notification for this reply. Thank you! You seem really good at scripting.

There’s also the math library function named ‘modf’ which is specifically catered for this purpose (splitting a number into its integral part and its fractional part).

local integral, fraction = math.modf(math.pi)
print(integral, fraction) --3 0.14...
3 Likes