I’ve made a stud height GUI that shows how high are you in studs from the Y axis of your PrimaryPart of your character. I use math.floor()
to prevent decimals from appearing but in exchange, the script kind of malfunctions?
Here’s a GIF below to show the problem.
On the left is me along with the GUI above and on the right is the output. The output prints out both the math.floor()
number and the original number. They don’t match with the GUI.
I’m not sure if it’s my code making it look weird or math.floor()
is having a field trip.
Here’s my code.
rs.RenderStepped:Connect(function()
if char.Parent ~= nil and char and char.PrimaryPart then
print(math.floor(char.PrimaryPart.Position.Y),char.PrimaryPart.Position.Y)
script.Parent.Text = string.format('<stroke color="#323232" joins="miter" thickness="3" transparency="0"><font size="50">%s</font><br/><font size="25">studs</font></stroke>', math.floor(char.PrimaryPart.Position.Y))
end
end)
I’ve also tried math.round()
and math.ceil()
but both returned the same result (4 and 3 this time.)