for g,G in pairs(lights:GetChildren())do if G:IsA("\073\109\097\103\101\066\117\116\116\111\110")and G.Name~="\104\101\097\100\101\114"then if string.match(G.Name,"\037\108\043")=="\116\100"then G.MouseButton1Click:connect(function()script.Parent.lighty.Value=tonumber(string.match(G.Name,"\037\100"))if script.Parent.lighty.Value==0 then lights.td0.Image=imgassets.offon lights.td1.Image=imgassets.hazardoff lights.td2.Image=imgassets.leftyoff lights.td3.Image=imgassets.rightyoff lights.td4.Image=imgassets.outoff elseif script.Parent.lighty.Value==1 then lights.td0.Image=imgassets.offoff lights.td1.Image=imgassets.hazardon lights.td2.Image=imgassets.leftyoff lights.td3.Image=imgassets.rightyoff lights.td4.Image=imgassets.outoff elseif script.Parent.lighty.Value==2 then lights.td0.Image=imgassets.offoff lights.td1.Image=imgassets.hazardoff lights.td2.Image=imgassets.leftyon lights.td3.Image=imgassets.rightyoff lights.td4.Image=imgassets.outoff elseif script.Parent.lighty.Value==3 then lights.td0.Image=imgassets.offoff lights.td1.Image=imgassets.hazardoff lights.td2.Image=imgassets.leftyoff lights.td3.Image=imgassets.rightyon lights.td4.Image=imgassets.outoff elseif script.Parent.lighty.Value==4 then lights.td0.Image=imgassets.offoff lights.td1.Image=imgassets.hazardoff lights.td2.Image=imgassets.leftyoff lights.td3.Image=imgassets.rightyoff lights.td4.Image=imgassets.outon end end)elseif string.match(G.Name,"\037\108\043")=="\102\108"then G.MouseButton1Click:connect(function()script.Parent.flasher.Value=tonumber(string.match(G.Name,"\037\100"))if script.Parent.flasher.Value==0 then lights.fl0.Image=imgassets.offon lights.fl1.Image=imgassets.slowoff lights.fl2.Image=imgassets.fastoff lights.fl3.Image=imgassets.x2off lights.fl4.Image=imgassets.x4off elseif script.Parent.flasher.Value==1 then lights.fl0.Image=imgassets.offoff lights.fl1.Image=imgassets.slowon lights.fl2.Image=imgassets.fastoff lights.fl3.Image=imgassets.x2off lights.fl4.Image=imgassets.x4off elseif script.Parent.flasher.Value==2 then lights.fl0.Image=imgassets.offoff lights.fl1.Image=imgassets.slowoff lights.fl2.Image=imgassets.faston lights.fl3.Image=imgassets.x2off lights.fl4.Image=imgassets.x4off elseif script.Parent.flasher.Value==3 then lights.fl0.Image=imgassets.offoff lights.fl1.Image=imgassets.slowoff lights.fl2.Image=imgassets.fastoff lights.fl3.Image=imgassets.x2on lights.fl4.Image=imgassets.x4off elseif script.Parent.flasher.Value==4 then lights.fl0.Image=imgassets.offoff lights.fl1.Image=imgassets.slowoff lights.fl2.Image=imgassets.fastoff lights.fl3.Image=imgassets.x2off lights.fl4.Image=imgassets.x4on end end)end end end for g,G in pairs(siren:GetChildren())do if G:IsA("\073\109\097\103\101\066\117\116\116\111\110")and G.Name~="\104\101\097\100\101\114"then if string.match(G.Name,"\037\108\043")=="\115\114"then G.MouseButton1Click:connect(function()script.Parent.siren.Value=tonumber(string.match(G.Name,"\037\100"))if script.Parent.siren.Value==0 then siren.sr0.Image=imgassets.offon siren.sr1.Image=imgassets.onoff elseif script.Parent.siren.Value==1 then siren.sr0.Image=imgassets.offoff siren.sr1.Image=imgassets.onon end end)end end end for g,G in pairs(seats:GetChildren())do if G:IsA("\073\109\097\103\101\066\117\116\116\111\110")and G.Name~="\104\101\097\100\101\114"then if string.match(G.Name,"\037\117\037\108\043")=="\083\101\097\116"then local g=seat:findFirstChild("\083\101\097\116"..tonumber(string.match(G.Name,"\037\100")))if g.Value then G.Image=imgassets.lockon else G.Image=imgassets.lockoff end G.MouseButton1Click:connect(function()g.Value=not g.Value if g.Value then G.Image=imgassets.lockon else G.Image=imgassets.lockoff end end)end end end while true do wait(.1)script.Parent.Speed.Text="\083\112\101\101\100\058 "..math.floor(seat.Velocity.Magnitude/2)end

for _,i in pairs(lights:GetChildren()) do
	if i:IsA("ImageButton") and i.Name ~= "header" then
		if string.match(i.Name,"%l+") == "td" then
			i.MouseButton1Click:connect(function()
				script.Parent.lighty.Value = tonumber(string.match(i.Name,"%d"))
				if script.Parent.lighty.Value == 0 then
					lights.td0.Image = imgassets.offon
					lights.td1.Image = imgassets.hazardoff
					lights.td2.Image = imgassets.leftyoff
					lights.td3.Image = imgassets.rightyoff
					lights.td4.Image = imgassets.outoff
				elseif script.Parent.lighty.Value == 1 then
					lights.td0.Image = imgassets.offoff
					lights.td1.Image = imgassets.hazardon
					lights.td2.Image = imgassets.leftyoff
					lights.td3.Image = imgassets.rightyoff
					lights.td4.Image = imgassets.outoff
				elseif script.Parent.lighty.Value == 2 then
					lights.td0.Image = imgassets.offoff
					lights.td1.Image = imgassets.hazardoff
					lights.td2.Image = imgassets.leftyon
					lights.td3.Image = imgassets.rightyoff
					lights.td4.Image = imgassets.outoff
				elseif script.Parent.lighty.Value == 3 then
					lights.td0.Image = imgassets.offoff
					lights.td1.Image = imgassets.hazardoff
					lights.td2.Image = imgassets.leftyoff
					lights.td3.Image = imgassets.rightyon
					lights.td4.Image = imgassets.outoff
				elseif script.Parent.lighty.Value == 4 then
					lights.td0.Image = imgassets.offoff
					lights.td1.Image = imgassets.hazardoff
					lights.td2.Image = imgassets.leftyoff
					lights.td3.Image = imgassets.rightyoff
					lights.td4.Image = imgassets.outon	
				end
			end)
		elseif string.match(i.Name,"%l+") == "fl" then
			i.MouseButton1Click:connect(function()
				script.Parent.flasher.Value = tonumber(string.match(i.Name,"%d"))
				if script.Parent.flasher.Value == 0 then
					lights.fl0.Image = imgassets.offon
					lights.fl1.Image = imgassets.slowoff
					lights.fl2.Image = imgassets.fastoff
					lights.fl3.Image = imgassets.x2off
					lights.fl4.Image = imgassets.x4off
				elseif script.Parent.flasher.Value == 1 then
					lights.fl0.Image = imgassets.offoff
					lights.fl1.Image = imgassets.slowon
					lights.fl2.Image = imgassets.fastoff
					lights.fl3.Image = imgassets.x2off
					lights.fl4.Image = imgassets.x4off
				elseif script.Parent.flasher.Value == 2 then
					lights.fl0.Image = imgassets.offoff
					lights.fl1.Image = imgassets.slowoff
					lights.fl2.Image = imgassets.faston
					lights.fl3.Image = imgassets.x2off
					lights.fl4.Image = imgassets.x4off
				elseif script.Parent.flasher.Value == 3 then
					lights.fl0.Image = imgassets.offoff
					lights.fl1.Image = imgassets.slowoff
					lights.fl2.Image = imgassets.fastoff
					lights.fl3.Image = imgassets.x2on
					lights.fl4.Image = imgassets.x4off
				elseif script.Parent.flasher.Value == 4 then
					lights.fl0.Image = imgassets.offoff
					lights.fl1.Image = imgassets.slowoff
					lights.fl2.Image = imgassets.fastoff
					lights.fl3.Image = imgassets.x2off
					lights.fl4.Image = imgassets.x4on			
				end
			end)
		end
	end
end

for _,i in pairs (siren:GetChildren()) do
	if i:IsA("ImageButton") and i.Name ~= "header" then
		if string.match(i.Name,"%l+") == "sr" then
			i.MouseButton1Click:connect(function()
				script.Parent.siren.Value = tonumber(string.match(i.Name,"%d"))
				if script.Parent.siren.Value == 0 then
					siren.sr0.Image = imgassets.offon
					siren.sr1.Image = imgassets.onoff
				elseif script.Parent.siren.Value == 1 then
					siren.sr0.Image = imgassets.offoff
					siren.sr1.Image = imgassets.onon
				end
			end)
		end
	end
end

for _,i in pairs (seats:GetChildren()) do
	if i:IsA("ImageButton") and i.Name ~= "header" then
		if string.match(i.Name,"%u%l+") == "Seat" then
			local a = seat:findFirstChild("Seat"..tonumber(string.match(i.Name,"%d")))
			if a.Value then
				i.Image = imgassets.lockon
			else
				i.Image = imgassets.lockoff
			end
			i.MouseButton1Click:connect(function()
				a.Value = not a.Value
				if a.Value then
					i.Image = imgassets.lockon
				else
					i.Image = imgassets.lockoff
				end
			end)
		end
	end
end
	
while true do
	wait(0.1)
	script.Parent.Speed.Text = ("Speed: "..math.floor(seat.Velocity.Magnitude/2))
end
