mouse.KeyDown:connect(function(y)y=string.lower(y)if y=="\107"then if cam=="\099\097\114"then Camera.CameraSubject=player.Character.Humanoid Camera.CameraType="\067\117\115\116\111\109"cam="\102\114\101\101\112\108\114"Camera.FieldOfView=70 elseif cam=="\102\114\101\101\112\108\114"then Camera.CameraSubject=player.Character.Humanoid Camera.CameraType="\065\116\116\097\099\104"cam="\108\111\099\107\112\108\114"Camera.FieldOfView=45 elseif cam=="\108\111\099\107\112\108\114"then Camera.CameraSubject=carSeat Camera.CameraType="\067\117\115\116\111\109"cam="\099\097\114"Camera.FieldOfView=70 end elseif y=="\117"then if windows==false then winfob.Visible=true windows=true else windows=false winfob.Visible=false end elseif y=="\091"then if carSeat.Parent.Body.MP.Sound.Volume>0 then handler:FireServer("\117\112\100\097\116\101\086\111\108\117\109\101",-0.5)end elseif y=="\093"then if carSeat.Parent.Body.MP.Sound.Volume<10 then handler:FireServer("\117\112\100\097\116\101\086\111\108\117\109\101",.5)end elseif y=="\102"then handler:FireServer("\070\077\083\119\105\116\099\104")elseif y=="\110"then handler:FireServer("\073\077\111\100\101")elseif y=="\106"then if carSeat.Seatlock.Value==false then handler:FireServer("\115\101\097\116\108\111\099\107",true,0)else handler:FireServer("\115\101\097\116\108\111\099\107",false,12)end end end)for y,k in pairs(script.Parent:getChildren())do if k:IsA("\073\109\097\103\101\066\117\116\116\111\110")then k.MouseButton1Click:connect(function()if carSeat.Windows:FindFirstChild(k.Name)then local y=carSeat.Windows:FindFirstChild(k.Name)if y.Value==true then handler:FireServer("\117\112\100\097\116\101\087\105\110\100\111\119\115",y.Name,false)else handler:FireServer("\117\112\100\097\116\101\087\105\110\100\111\119\115",y.Name,true)end end end)end end HUB.Limiter.MouseButton1Click:connect(function()if carSeat.IsOn.Value==false then carSeat.IsOn.Value=true carSeat.Startup:Play()wait(1)else carSeat.IsOn.Value=false end end)winfob.mg.Play.MouseButton1Click:connect(function()handler:FireServer("\117\112\100\097\116\101\083\111\110\103",winfob.mg.Input.Text)end)winfob.mg.Stop.MouseButton1Click:connect(function()handler:FireServer("\112\097\117\115\101\083\111\110\103")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.DashSc.G.Left.Visible=true script.Parent.HUB.Left.Visible=true else carSeat.Parent.Body.Dash.DashSc.G.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.DashSc.G.Right.Visible=true script.Parent.HUB.Right.Visible=true else carSeat.Parent.Body.Dash.DashSc.G.Right.Visible=false script.Parent.HUB.Right.Visible=false end end)while wait()do if carSeat.Parent:FindFirstChild("\066\111\100\121")then carSeat.Parent.Body.Dash.Speed.G.Speed.Text=math.floor(carSeat.Velocity.magnitude*.56818181818182)end carSeat.Parent.Body.Dash.Screen.G.BG.Time.Text=game.Lighting.TimeOfDay carSeat.Parent.Body.Dash.Screen.G.Blank.Time.Text=game.Lighting.TimeOfDay end
-------------------------

mouse.KeyDown:connect(function(key)
	key = string.lower(key)
	if key == "k" then --Camera controls
		if cam == "car" then
			Camera.CameraSubject = player.Character.Humanoid
			Camera.CameraType = "Custom"
			cam = "freeplr"
			Camera.FieldOfView = 70
		elseif cam == "freeplr" then
			Camera.CameraSubject = player.Character.Humanoid
			Camera.CameraType = "Attach"
			cam = "lockplr"
			Camera.FieldOfView = 45
		elseif cam == "lockplr" then
			Camera.CameraSubject = carSeat
			Camera.CameraType = "Custom"
			cam = "car"
			Camera.FieldOfView = 70
		end
	elseif key == "u" then --Window controls
		if windows == false then
			winfob.Visible = true
			windows = true
		else
			windows = false
			winfob.Visible = false
		end
	elseif key == "[" then -- volume down
		if carSeat.Parent.Body.MP.Sound.Volume > 0 then
			handler:FireServer("updateVolume", -0.5)
		end
	elseif key == "]" then -- volume up
		if carSeat.Parent.Body.MP.Sound.Volume < 10 then
			handler:FireServer("updateVolume", 0.5)
		end
	elseif key == "f" then --FM Screen Switch
		handler:FireServer("FMSwitch")
	elseif key == "n" then --Mode Screen Switch
		handler:FireServer("IMode")
	elseif key == "j" then --seatlock
		if carSeat.Seatlock.Value == false then
			handler:FireServer("seatlock", true, 0)
		else
			handler:FireServer("seatlock", false, 12)
		end
	end
end)

for i, v in pairs(script.Parent:getChildren()) do
	if v:IsA("ImageButton") 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
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)

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

winfob.mg.Stop.MouseButton1Click:connect(function() --Play the next song
	handler:FireServer("pauseSong")
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.DashSc.G.Left.Visible = true
		script.Parent.HUB.Left.Visible = true
	else
		carSeat.Parent.Body.Dash.DashSc.G.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.DashSc.G.Right.Visible = true
		script.Parent.HUB.Right.Visible = true
	else
		carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = false
		script.Parent.HUB.Right.Visible = false
	end
end)

while wait() do
	if carSeat.Parent:FindFirstChild("Body") then
		carSeat.Parent.Body.Dash.Speed.G.Speed.Text = math.floor(carSeat.Velocity.magnitude * ((10 / 12) * (60 / 88)))
	end
	carSeat.Parent.Body.Dash.Screen.G.BG.Time.Text = game.Lighting.TimeOfDay
	carSeat.Parent.Body.Dash.Screen.G.Blank.Time.Text = game.Lighting.TimeOfDay
end
