If statement half works

if math.round(frame.Size.X.Scale * 10) == 64 then
				
				print("Ran out of stamina")
			else
				print("Still have stamina")
			end

im tryin to make an if statement that says if the frame = a certain size then it’ll print ran out of stamina but it only prints still have stamina. whats wrong with my code?

and before the if statement i have a tween which will set its size to (0, 64,0, 100)

Did you mean X.Offset? For this to work right now the first number in the size has to be 6.4

1 Like

didnt know i had to put offset

i changed it to

if math.round(frame.Size.X.Offset * 10)  == 64 then

it still doesnt work

Print(math.round(frame.Size.X.Offset * 10))
To see what your getting.

6740 and dang i never new you could do that

Prints will help you fix so much!

When having issues add prints after/before if statements to make sure you are getting what you’re asking

thank you so much for helping and why the flip does my statements have to be “number” of characters long

So if you get rid of the *10 will it work?

i have no idea and im sorry that i have to say it so drawn out if i dont roblox wont let me talk

You need to also divide the result by 10 to round the number to 1 decimal place like so:

if math.round(frame.Size.X.Offset * 10) / 10 == 64 then
	print("Ran out of stamina")
else
	print("Still have stamina")
end

And also use the offset like @azqjanna correctly suggested