-----------------------------------------------------------------------------------------------

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.sirenson
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 1 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailon
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 2 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpon
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 3 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseron
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 4 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hiloon
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 5 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornon
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 6 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailon
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleron
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 7 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpon
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleron
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 8 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseron
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleron
					siren.sr9.Image = imgassets.hyperhilooff
				elseif script.Parent.siren.Value == 9 then
					siren.sr0.Image = imgassets.sirensoff
					siren.sr1.Image = imgassets.wailoff
					siren.sr2.Image = imgassets.yelpoff
					siren.sr3.Image = imgassets.phaseroff
					siren.sr4.Image = imgassets.hilooff
					siren.sr5.Image = imgassets.hornoff
					siren.sr6.Image = imgassets.wailrumbleroff
					siren.sr7.Image = imgassets.yelprumbleroff
					siren.sr8.Image = imgassets.phaserrumbleroff
					siren.sr9.Image = imgassets.hyperhiloon
				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
					seat.Parent.SSC.Beep:Play()
				else
					i.Image = imgassets.lockoff
					seat.Parent.SSC.Beep:Play()
				end
			end)
		end
	end
end
	
while true do
	wait(0.01)
	script.Parent.Speed.Text = ("Speed: "..math.floor(seat.Velocity.Magnitude/2))
end
