wait(.1)local s=script.Parent function GetPlayerFromWeld(s)if s.Part1.Name=="\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"then local P=s.Part1.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if P then local s=game.Players:GetPlayerFromCharacter(P.Parent)if s then return s end end end return nil end s.ChildAdded:connect(function(P)if P:IsA("\087\101\108\100")then local m=GetPlayerFromWeld(P)if m then local P=script.SpeedGUI:Clone()wait(.1)P.Car.Value=s P.Parent=m.PlayerGui end end end)s.ChildRemoved:connect(function(s)if s:IsA("\087\101\108\100")then local P=GetPlayerFromWeld(s)if P then if P.PlayerGui:findFirstChild("\083\112\101\101\100\071\085\073")then P.PlayerGui.SpeedGUI:Destroy()end end end end)
-- Instruction: Put in a (Vehicle)Seat.
wait(0.1)

local seat = script.Parent

function GetPlayerFromWeld(weld)
	if weld.Part1.Name == "HumanoidRootPart" then
		local character = weld.Part1.Parent:findFirstChild("Humanoid")
		if character then
			local player = game.Players:GetPlayerFromCharacter(character.Parent)
			if player then
				return player
			end
		end
	end
	return nil
end

seat.ChildAdded:connect(function(newChild)
	if newChild:IsA("Weld") then
		local player = GetPlayerFromWeld(newChild)
		if player then
			local newGUI = script.SpeedGUI:Clone()
			wait(0.1)
			newGUI.Car.Value = seat
			newGUI.Parent = player.PlayerGui
		end
	end
end)

seat.ChildRemoved:connect(function(oldChild)
	if oldChild:IsA("Weld") then
		local player = GetPlayerFromWeld(oldChild)
		if player then
			if player.PlayerGui:findFirstChild("SpeedGUI") then
				player.PlayerGui.SpeedGUI:Destroy()
			end
		end
	end
end)
