local n=script.Parent:WaitForChild("\066\117\116\116\111\110")local u=script.Parent.Parent.Car.Value local t=script.Parent:WaitForChild("\087\105\110\100\111\119\070\114\097\109\101")local C=t:WaitForChild("\077\097\105\110\070\114\097\109\101")local U=C:WaitForChild("\073\110\116\101\114\105\111\114\076\105\103\104\116")local K=C:WaitForChild("\070\076")local Q=C:WaitForChild("\070\082")local Z=false local o=C:WaitForChild("\082\082")local d=C:WaitForChild("\072\111\111\100")local s=C:WaitForChild("\084\114\117\110\107")local A=C:WaitForChild("\082\076")local j=u:WaitForChild("\066\077\087\080\097\110\101\108\095\072\097\110\100\108\101\114")d.MouseButton1Down:connect(function()j:FireServer("\072\111\111\100")end)K.MouseButton1Down:connect(function()if Z==false then Z=true j:FireServer("\087\105\110\100\111\119\115","\070\076")wait(1)Z=false end end)Q.MouseButton1Down:connect(function()if Z==false then Z=true j:FireServer("\087\105\110\100\111\119\115","\070\082")wait(1)Z=false end end)o.MouseButton1Down:connect(function()if Z==false then Z=true j:FireServer("\087\105\110\100\111\119\115","\082\082")wait(1)Z=false end end)A.MouseButton1Down:connect(function()if Z==false then Z=true j:FireServer("\087\105\110\100\111\119\115","\082\076")wait(1)Z=false end end)n.MouseButton1Down:Connect(function()if t.Visible==false then t.Visible=true else t.Visible=false end end)U.MouseButton1Down:connect(function()j:FireServer("\076\105\103\104\116")end)for n,u in pairs(t.AmbientLighting:GetChildren())do if u:IsA("\073\109\097\103\101\066\117\116\116\111\110")then u.MouseButton1Down:connect(function()j:FireServer("\065\077\066",u.Name)end)end end s.MouseButton1Down:connect(function()j:FireServer("\084\075")end)t.AmbientLighting.BACK.MouseButton1Down:connect(function()C.Visible=true t.AmbientLighting.Visible=false end)C.AMBSettings.MouseButton1Down:connect(function()C.Visible=false t.AmbientLighting.Visible=true end)
--by Repilee 5/1/18--
--(plez no leak kthxbai)

local BMWButton = script.Parent:WaitForChild("Button")
local car = script.Parent.Parent.Car.Value
local WindowFrame = script.Parent:WaitForChild("WindowFrame")
local MainFrame = WindowFrame:WaitForChild("MainFrame")
local LightBtn = MainFrame:WaitForChild("InteriorLight")
local FL = MainFrame:WaitForChild("FL")
local FR = MainFrame:WaitForChild("FR")
local debounce = false
local RR = MainFrame:WaitForChild("RR")
local H = MainFrame:WaitForChild("Hood")
local TK = MainFrame:WaitForChild("Trunk")
local RL = MainFrame:WaitForChild("RL")

local handler = car:WaitForChild("BMWPanel_Handler")

H.MouseButton1Down:connect(function()
	handler:FireServer("Hood")
end)

FL.MouseButton1Down:connect(function()
	if debounce == false then
		debounce = true
		handler:FireServer("Windows", "FL")
		wait(1)
		debounce = false
	end
end)
FR.MouseButton1Down:connect(function()
	if debounce == false then
		debounce = true
		handler:FireServer("Windows", "FR")
		wait(1)
		debounce = false
	end
end)
RR.MouseButton1Down:connect(function()
	if debounce == false then
		debounce = true
		handler:FireServer("Windows", "RR")
		wait(1)
		debounce = false
	end
end)
RL.MouseButton1Down:connect(function()
	if debounce == false then
		debounce = true
		handler:FireServer("Windows", "RL")
		wait(1)
		debounce = false
	end
end)

BMWButton.MouseButton1Down:Connect(function()
	if WindowFrame.Visible == false then
		WindowFrame.Visible = true
	else
		WindowFrame.Visible = false
	end
end)

LightBtn.MouseButton1Down:connect(function()
	handler:FireServer("Light")
end)

for i, btn in pairs(WindowFrame.AmbientLighting:GetChildren()) do
	if btn:IsA("ImageButton") then
		btn.MouseButton1Down:connect(function()
			handler:FireServer("AMB", btn.Name)
		end)
	end
end

TK.MouseButton1Down:connect(function()
	handler:FireServer("TK")
end)

WindowFrame.AmbientLighting.BACK.MouseButton1Down:connect(function()
	MainFrame.Visible = true
	WindowFrame.AmbientLighting.Visible = false
end)

MainFrame.AMBSettings.MouseButton1Down:connect(function()
	MainFrame.Visible = false
	WindowFrame.AmbientLighting.Visible = true
end)
