---Misc

function Misc()
	local function GetHelp()
		local a=false
		for i=1,9 do
			a=not a
			wait(.2)
			if a then
				script.Parent.Help.Style=Enum.ButtonStyle.RobloxRoundDropdownButton
			else
				script.Parent.Help.Style=Enum.ButtonStyle.RobloxRoundDefaultButton
			end
		end
	end
	GetHelp()
	script.Parent.Help.MouseButton1Click:connect(function()
		script.Parent.Controls.Visible=not script.Parent.Controls.Visible
	end)
	script.Parent:WaitForChild("Light")
	local light=0
	local function Light(on)
		for i,v in pairs(car.Body.Lights:GetChildren()) do
			if v:FindFirstChild("Light")~=nil then
				v.Light.Enabled=on
			end
			if on and v.BrickColor~=BrickColor.new("Really black") then
				v.Material=Enum.Material.Neon
			else
				v.Material=Enum.Material.SmoothPlastic
			end
		end
	end
	local function AutoLight()
		if light==0 then
			if (game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050) then
				Light(true)
			else
				Light(false)
			end
		end
	end
	script.Parent.Light.MouseButton1Click:connect(function()
		if light==1 then
			light=-1
		else
			light=light+1
		end
		if light==0 then
			script.Parent.Light.Text="Lights: Auto"
			if game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050 then
				Light(true)
			else
				Light(false)
			end
		elseif light==1 then
			script.Parent.Light.Text="Lights: On"
			Light(true)
		else
			script.Parent.Light.Text="Lights: Off"
			Light(false)
		end
	end)
	local function BrakeLights()
		for i,v in pairs(car.Body.Lights:GetChildren()) do
			if v.Name=="R" then
				if v.Light.Enabled then
					if GBrake>0 then
						v.Transparency=0
						v.Light.Brightness=12
					else
						v.Transparency=.3
						v.Light.Brightness=8
					end
				else
					if GBrake>0 then
						v.Material=Enum.Material.Neon
					else
						v.Material=Enum.Material.SmoothPlastic
					end
				end
			end
		end
	end
	game.Lighting.Changed:connect(AutoLight)
	AutoLight()
	local FlipWait=tick()
	local FlipDB=false
	local function FlipCar()
		local gyro = car.DriveSeat.Flip
		gyro.maxTorque = Vector3.new(10000,0,10000)
		gyro.P=3000
		gyro.D=500
		wait(2)
		gyro.maxTorque = Vector3.new(0,0,0)
		gyro.P=0
		gyro.D=0
		FlipDB=false
	end
	local function GetFlip()
		if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
			FlipWait=tick()
		else
			if tick()-FlipWait>=3 then
				FlipDB=true
				FlipCar()
			end
		end
	end
	--run:BindToRenderStep("BrakeL",Enum.RenderPriority.Last.Value,BrakeLights)
	--run:BindToRenderStep("Flip",Enum.RenderPriority.Last.Value,GetFlip)
	--table.insert(Binded,"BrakeL")
	--table.insert(Binded,"Flip")
	table.insert(LoopRun,BrakeLights)
	table.insert(LoopRun,GetFlip)
end
Misc()