-- Variables (best not to touch these!)

local button = script.Parent 
local car = script.Parent.Parent.Car.Value
local sound = script.Parent.StartD
local startsound = script.Parent.StartChime
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
	if script.Parent.Text == "Engine: OFF" then -- If the text says it's off then..
		startsound:play()
wait(1)
		sound:Play() 
		wait(2.7)
		script.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
		button.Text = "Engine: On"
		script.Parent.Parent.AC6C_Stock_Gauges:TweenPosition(UDim2.new(0, 0,-0.3, 0), "Out", "Quad", 1)



		wait(3)
		script.Parent.Parent.FollowNotification:TweenPosition(UDim2.new(1, -200,1, -100), "Out", "Quad", 1)
		script.Parent.Notif:play()
		sound:stop()
		startsound:Stop()
		


		wait(3)
		script.Parent.Parent.FollowNotification:TweenPosition(UDim2.new(1, 0,1, -100), "Out", "Quad", 1)




	else -- If it's on then when you click the button,
		script.Parent.Parent.IsOn.Value = false -- The car is turned off.

		button.Text = "Engine: OFF"
		script.Parent.EngineOff:play()

	end -- Don't touch this.
end) -- And don't touch this either.
