VelocityCounter broken

Hi!
I have this script here that is non functional. It should make the text the y pos.

script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Character.Torso.Velocity.Y
wait()
end

This does not work.

while true do
    script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Character.Torso.Velocity.Y
    wait(1)
end

Still not working.

script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Character.Torso.Velocity.Y
wait(1)
end

Are there any errors in the output?

No. It’s just the empty UI frame.

<— highest point in the map

Are you measuring velocity or distance from 0,0,0? And is script.Parent.Parent.Parent.Parent.Parent supposed to be the player? Also is it a LocalScript or a server Script?

Yes. label, frame, ui, part, startergui, workspace. It’s a normal script, and I’m measuring from a normal part

Are you measuring the elevation of the player? Velocity is the speed of the player not the position

Yes, I’m going after the velocity. If height is easier, that works too.

Try putting a print in the loop to see if it’s even running

image It wont even print. This is where it’ located.

while true do
	print "pls work"
script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Character.Torso.Velocity.Y
wait(1)
end

Is that everything that’s in the script? Or is there something above

Nothing above. Just that part ff

script.Parent.Parent.Parent.Parent.Parent is the PlayerGui I think, also Torso doesn’t exist in R15 characters so you should use HumanoidRootPart instead.

Try

script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.Velocity.Y
1 Like

it works, but it always has a number like "“89.99568496835835783856838”

Use wait() instead of wait(1) so it updates faster and you can use math.floor() on the number to round it down.

math.floor(script.Parent.Parent.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.Velocity.Y)