F.lock=function(s)if s then for s,Z in pairs(script.Parent.Parent.Misc:GetDescendants())do if Z:IsA("\077\111\116\111\114")then if Z.Parent.Parent.Name=="\077\105\114\114\111\114"then Z.DesiredAngle=0 else end end end carSeat.Lock:Play()else carSeat.Unlock:Play()wait(.4)carSeat.Unlock:Play()end for Z,A in pairs(script.Parent.Parent.Misc:GetDescendants())do if A:IsA("\067\108\105\099\107\068\101\116\101\099\116\111\114")then A.MaxActivationDistance=s and 0 or 12 end end end local s=0 F.rs=function(Z)local A=require(carSeat.Parent:FindFirstChild("\065-\067\104\097\115\115\105\115 \084\117\110\101"))carSeat.IsOn.Value=Z if Z then carSeat.Startup:Play()if not car.DriveSeat.IsOn.Value then s=math.max(s-.015,0)else s=1 end car.DriveSeat.Rev.Pitch=(car.DriveSeat.Rev.SetPitch.Value+(car.DriveSeat.Rev.SetRev.Value*A.IdleRPM)/A.Redline)*s^2 else car.DriveSeat.Rev.Pitch=0 carSeat.Startup:Stop()end end F.user=function()carSeat.Parent:Destroy()end F.tk=function(s)carSeat.Parent.Misc.TK.SS.Motor.DesiredAngle=s and 1.5 or 0 end script.Parent.OnServerEvent:connect(function(s,Z,...)if F[Z]then F[Z](...)end end)


F.lock = function(x)
	if x then
		for i,v in pairs(script.Parent.Parent.Misc:GetDescendants()) do
			if v:IsA("Motor") then
				if v.Parent.Parent.Name == "Mirror" then
					 v.DesiredAngle = 0
				else
				end
			end
		end
		carSeat.Lock:Play()
	else
		carSeat.Unlock:Play()
		wait(.4)
		carSeat.Unlock:Play()
	end
	for i,v in pairs(script.Parent.Parent.Misc:GetDescendants()) do
		if v:IsA("ClickDetector") then
			v.MaxActivationDistance = x and 0 or 12
		end
	end
end

local on = 0

F.rs = function(y)
	local tune = require(carSeat.Parent:FindFirstChild("A-Chassis Tune"))
	carSeat.IsOn.Value = y
	if y then
		carSeat.Startup:Play()
		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*tune.IdleRPM/tune.Redline)*on^2
	else car.DriveSeat.Rev.Pitch = 0
		carSeat.Startup:Stop()
	end
end

F.user = function()
	carSeat.Parent:Destroy()
end

F.tk = function(b)
	carSeat.Parent.Misc.TK.SS.Motor.DesiredAngle = b and 1.5 or 0
end

script.Parent.OnServerEvent:connect(function(Player, Func, ...)
	if F[Func] then
		F[Func](...)
	end
end)
