local Y=script.Parent.Bike.Value local F=workspace.CurrentCamera local W=game:GetService("\082\117\110\083\101\114\118\105\099\101")Y.DriveSeat.ChildRemoved:connect(function(Y)if Y.Name=="\083\101\097\116\087\101\108\100"then W:UnbindFromRenderStep("\077\067\097\109")F.CameraType=Enum.CameraType.Custom end end)script.Parent.Values.MouseSteerOn.Changed:connect(function(m)if script.Parent.Values.MouseSteerOn.Value then W:BindToRenderStep("\077\067\097\109",Enum.RenderPriority.Camera.Value,function()F.CameraType=Enum.CameraType.Scriptable local W=math.min(1,Y.DriveSeat.Velocity.Magnitude/500)local m=((Y.DriveSeat.Position+Vector3.new(0,8+W*2,0))-Y.DriveSeat.CFrame.lookVector*17)+(Y.DriveSeat.Velocity.Unit*-7)*W F.CoordinateFrame=CFrame.new(m,Y.DriveSeat.Position)end)else W:UnbindFromRenderStep("\077\067\097\109")F.CameraType=Enum.CameraType.Custom end end)
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

local car = script.Parent.Bike.Value
local cam = workspace.CurrentCamera
local RS = game:GetService("RunService")

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name == "SeatWeld" then
		RS:UnbindFromRenderStep("MCam")
		cam.CameraType = Enum.CameraType.Custom
	end
end)

script.Parent.Values.MouseSteerOn.Changed:connect(function(property)
	if script.Parent.Values.MouseSteerOn.Value then
		RS:BindToRenderStep("MCam", Enum.RenderPriority.Camera.Value, function()
			cam.CameraType = Enum.CameraType.Scriptable
			local pspeed = math.min(1, car.DriveSeat.Velocity.Magnitude / 500)
			local cc = car.DriveSeat.Position
				+ Vector3.new(0, 8 + (pspeed * 2), 0)
				- (car.DriveSeat.CFrame.lookVector * 17)
				+ (car.DriveSeat.Velocity.Unit * -7 * pspeed)
			cam.CoordinateFrame = CFrame.new(cc, car.DriveSeat.Position)
		end)
	else
		RS:UnbindFromRenderStep("MCam")
		cam.CameraType = Enum.CameraType.Custom
	end
end)
