Way to connect roblox car speed to gui?

Hello! I basically want to connect robloxs throttle bar to a gui.
image

How would I achieve this?

3 Likes

The first thing would be to hide HeadsUpDisplay and you would get the speed with the Magnitude of the speed of the car

local DriveSeat = --path to VehicleSeat
local Velocity = DriveSeat.AssemblyLinearVelocity.Magnitude
print(Velocity)
1 Like

How would you disable the headsupdisplay? and where would this script me located?

HeadsUpDisplay is a property of VehicleSeat
image


The code can be local or from the server, just add it to a code you have, an updater example

local DriveSeat = -- path to VehicleSeat
game:GetService("RunService").Heartbeat:Connect(function()
	local Velocity = DriveSeat.AssemblyLinearVelocity.Magnitude
	print(Velocity)
end)

I connected it to the gui but my gui is not popping up when I enter the car?

You can show it using Seated

local DriveSeat =  -- path to VehicleSeat
local Gui = script.Parent

local Player = game:GetService("Players").LocalPlayer
local Humanoid = (Player.Character or Player.CharacterAdded:Wait()):WaitForChild("Humanoid")
Humanoid.Seated:Connect(function(State, Seat)
	if State and Seat == DriveSeat then
		Gui.Visible = true
	else
		Gui.Visible = false
	end
end)
1 Like

It still does not appear, is this supposed to be a local script or normal script?

If its a gui then leave it as a localscript

1 Like