--		elseif key == "j" then --Window controls
--		 if pal == false then 
--			palpal.Visible = true
--			pal = true
--		 else pal = false
--			palpal.Visible = false
--		 end

		elseif key == "[" then -- volume down
			if carSeat.Parent.Body.MP.Sound.Volume > 0 then
				handler:FireServer('updateVolume', -0.2)
			end
		elseif key == "]" then -- volume up
			if carSeat.Parent.Body.MP.Sound.Volume < 10 then
				handler:FireServer('updateVolume', 0.2)
			end	
	end
end)

HUB.Limiter.MouseButton1Click:connect(function() --Ignition
 if carSeat.IsOn.Value == false then
	carSeat.IsOn.Value = true
	carSeat.Startup:Play()
	wait(1)
else
	carSeat.IsOn.Value = false
end
end)

TR.SN.MouseButton1Click:connect(function() --Show tracker names
	script.Parent.Names.Value = true
end)

TR.HN.MouseButton1Click:connect(function() --Hide tracker names
	script.Parent.Names.Value = false
end)

winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song
	handler:FireServer('updateSong', winfob.mg.Input.Text)
end)

carSeat.Indicator.Changed:connect(function()
	if carSeat.Indicator.Value == true then
		script.Parent.Indicator:Play()
	else
		script.Parent.Indicator2:Play()
	end
end)

carSeat.LI.Changed:connect(function()
	if carSeat.LI.Value == true then
		carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Left.Visible = true
		script.Parent.HUB.Left.Visible = true
	else
		carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Left.Visible = false
		script.Parent.HUB.Left.Visible = false
	end
end)

carSeat.RI.Changed:connect(function()
	if carSeat.RI.Value == true then
		carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Right.Visible = true
		script.Parent.HUB.Right.Visible = true
	else
		carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Right.Visible = false
		script.Parent.HUB.Right.Visible = false
	end
end)

for i,v in pairs(script.Parent:getChildren()) do
	if v:IsA('TextButton') then
		v.MouseButton1Click:connect(function()
			if carSeat.Windows:FindFirstChild(v.Name) then
				local v = carSeat.Windows:FindFirstChild(v.Name)
				if v.Value == true then
					handler:FireServer('updateWindows', v.Name, false)
				else
					handler:FireServer('updateWindows', v.Name, true)
				end
			end
		end)
	end
end

while wait() do
	carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Time.Text = game.Lighting.TimeOfDay
	carSeat.Parent.Body.Dash.Screen.SurfaceGui.Time.Text = game.Lighting.TimeOfDay
	carSeat.Parent.Body.Dash.Screen2.SurfaceGui.Frame.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88)))
end
