local B=workspace.FilteringEnabled local c=script.Parent.Car.Value local o=require(c["\065-\067\104\097\115\115\105\115 \084\117\110\101"])local m=c.Body local g=c.SmeersLightsHandler local u=false local d=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")d.InputBegan:connect(function(B,c)if not c then if B.KeyCode==Enum.KeyCode.Z or B.KeyCode==Enum.KeyCode.DPadLeft then g:FireServer({ToggleLeftBlink=true})elseif B.KeyCode==Enum.KeyCode.C or B.KeyCode==Enum.KeyCode.DPadRight then g:FireServer({ToggleRightBlink=true})elseif B.KeyCode==Enum.KeyCode.V then g:FireServer({ToggleStandlicht=true})elseif B.KeyCode==Enum.KeyCode.X then g:FireServer({ToggleHazards=true})end end end)local W,K,q,v=.2,40,.1,3 local S=0 c.DriveSeat.Changed:Connect(function(B)if B=="\084\104\114\111\116\116\108\101"then if c.DriveSeat.Throttle==-1 then g:FireServer({EnableBrakes=true})if math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)>=K then repeat if math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)>=K then if c.DriveSeat.Throttle==-1 then S=S+.05 else S=0 break end else S=0 break end wait(.05)until S>=W if S>=W then S=0 if math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)>=K then repeat if math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)>=K or c.DriveSeat.Throttle==-1 then g:FireServer({EnableBrakes=true})wait(q)g:FireServer({DisableBrakes=true})wait(q)end until math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)<=v or c.DriveSeat.Throttle~=-1 if math.floor(.56818181818182*c.DriveSeat.Velocity.Magnitude)<=v then g:FireServer({ToggleHazards=true})g:FireServer({EnableBrakes=true})end end else S=0 end end else g:FireServer({DisableBrakes=true})end end end)script.Parent.Values.Gear.Changed:connect(function()if script.Parent.Values.Gear.Value==-1 then g:FireServer({ReverseOn=true})elseif script.Parent.Values.Gear.Value~=-1 then g:FireServer({ReverseOff=true})end end)
--Put Brakes,Headlight,Highlight,Left,Reverse,and Right into Body.
--Put this script into Plugins
-- Duplicate your lights, make it neon and put it inside G1 of the corrisponding model.
-- What it does is it enables a light inside the parts named Light and makes the part's transparency 0.
-- When its off, it disables the Light and sets the transparency to 1
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])

local body = car.Body

local event = car.SmeersLightsHandler

local dtapdleft = false

local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(input, gp)
	if not gp then
		if input.KeyCode == Enum.KeyCode.Z or input.KeyCode == Enum.KeyCode.DPadLeft then
			event:FireServer({ ["ToggleLeftBlink"] = true })
		elseif input.KeyCode == Enum.KeyCode.C or input.KeyCode == Enum.KeyCode.DPadRight then
			event:FireServer({ ["ToggleRightBlink"] = true })
		elseif input.KeyCode == Enum.KeyCode.V then
			event:FireServer({ ["ToggleStandlicht"] = true })
		elseif input.KeyCode == Enum.KeyCode.X then
			event:FireServer({ ["ToggleHazards"] = true })
		end
	end
end)

local Time, Activate, Blink, End = 0.2, 40, 0.1, 3
local CurrTime = 0 -- don't change this

car.DriveSeat.Changed:Connect(function(Change)
	if Change == "Throttle" then
		if car.DriveSeat.Throttle == -1 then
			event:FireServer({ ["EnableBrakes"] = true })
			if math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) >= Activate then
				repeat
					if math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) >= Activate then
						if car.DriveSeat.Throttle == -1 then
							CurrTime = CurrTime + 0.05
						else
							CurrTime = 0
							break
						end
					else
						CurrTime = 0
						break
					end
					wait(0.05)
				until CurrTime >= Time
				if CurrTime >= Time then
					CurrTime = 0
					if math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) >= Activate then
						repeat
							if
								math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) >= Activate
								or car.DriveSeat.Throttle == -1
							then
								event:FireServer({ ["EnableBrakes"] = true })
								wait(Blink)
								event:FireServer({ ["DisableBrakes"] = true })
								wait(Blink)
							end
						until math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) <= End
							or car.DriveSeat.Throttle ~= -1
						if math.floor((10 / 12) * (60 / 88) * car.DriveSeat.Velocity.Magnitude) <= End then
							event:FireServer({ ["ToggleHazards"] = true })
							event:FireServer({ ["EnableBrakes"] = true })
						end
					end
				else
					CurrTime = 0
				end
			end
		else
			event:FireServer({ ["DisableBrakes"] = true })
		end
	end
end)

script.Parent.Values.Gear.Changed:connect(function()
	if script.Parent.Values.Gear.Value == -1 then
		event:FireServer({ ["ReverseOn"] = true })
	elseif script.Parent.Values.Gear.Value ~= -1 then
		event:FireServer({ ["ReverseOff"] = true })
	end
end)
