Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Showing speed in a text label?

I'm trying to show a players speed in a TextLabel in a gui. I have written a script, but it doesn't work.

local plr = game.Players.LocalPlayer
local Character = plr.Character

Speed = math.floor(Character.HumanoidRootPart.Velocity.magnitude + 0.5)	
script.Parent.Text = Speed

1 answer

✓ Accepted answer
--LocalScript
local ply = game.Players.LocalPlayer
local char = ply.Character
local root = char:FindFirstChild("HumanoidRootPart")

local run = true

while run do
	local speed = math.floor(root.Velocity.magnitude + 0.5)
	script.Parent.Text = tostring(speed)
	wait()
end

1 comment

0

Thanks bro :)

This discussion is preserved as it was. New answers, comments, and votes are closed.