local function r()if Humanoid.SeatPart~=nil and Humanoid.SeatPart.Parent:FindFirstChild("\083\116\097\116\115")then Gui.Enabled=true local r=Char.Head.Velocity.magnitude Pointer.Rotation=180/(Humanoid.SeatPart.Parent.Stats.MaxSpeed.Value/(r*1.62))Pointer.Arc.Size=UDim2.new(4.5+math.abs(90-Pointer.Rotation)/45,0,.5,0)Board.Speed.Text=math.floor(r*1.62).." \075\077\047\072"workspace.Camera.FieldOfView=70+r*.1 else Gui.Enabled=false if script.Parent.Parent.Parent:FindFirstChild("\084\111\117\099\104\071\117\105")then script.Parent.Parent.Parent.TouchGui.Enabled=true script.Parent.Parent.MobileControls.Visible=false script.Parent.Parent.PCHandbrake.Visible=false end end end RunService.Heartbeat:Connect(r)
-------------------
---[[Functions]]---
-------------------

local function UpdateSpeedometer()
	if Humanoid.SeatPart ~= nil and Humanoid.SeatPart.Parent:FindFirstChild("Stats") then
		Gui.Enabled = true

		local Cached_Magnitude = Char.Head.Velocity.magnitude

		--print(Char.Humanoid.SeatPart.Parent["Stats"].MaxSpeed.Value)

		--print(math.ceil())

		Pointer.Rotation = (180 / (Humanoid.SeatPart.Parent["Stats"].MaxSpeed.Value / (Cached_Magnitude * 1.62))) ---OLD 1.8
		--print(math.abs(90 - ((Cached_Magnitude)*1.8))/45)
		Pointer.Arc.Size = UDim2.new(4.5 + (math.abs(90 - Pointer.Rotation) / 45), 0, 0.5, 0)

		Board.Speed.Text = math.floor(Cached_Magnitude * 1.62) .. " KM/H" ---OLD 1.8

		---Changing fov based on speed
		workspace.Camera.FieldOfView = 70 + (Cached_Magnitude * 0.1)
	else
		Gui.Enabled = false

		if script.Parent.Parent.Parent:FindFirstChild("TouchGui") then
			script.Parent.Parent.Parent["TouchGui"].Enabled = true
			script.Parent.Parent.MobileControls.Visible = false
			script.Parent.Parent.PCHandbrake.Visible = false
		end
	end
end

RunService.Heartbeat:Connect(UpdateSpeedometer)
