local m="\067\108\105\099\107\084\111\077\111\118\101\067\111\110\116\114\111\108\108\101\114"local E=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local M=game:GetService("\080\097\116\104\102\105\110\100\105\110\103\083\101\114\118\105\099\101")local Q=game:GetService("\080\108\097\121\101\114\115")local J=game:GetService("\082\117\110\083\101\114\118\105\099\101")local L=game:GetService("\068\101\098\114\105\115")local y=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local t=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local u=Q.LocalPlayer local n=u.PlayerScripts local q=script:FindFirstAncestor("\067\097\109\101\114\097\083\099\114\105\112\116")local P=nil if q then P=require(q:WaitForChild("\073\110\118\105\115\105\099\097\109"))end local R=script.Parent local H=require(R)local V=nil if H then local m=R:FindFirstChild("\084\111\117\099\104\074\117\109\112")if m then V=require(m)end end local w=true local a=workspace.FindPartOnRayWithIgnoreList local Z=math.min local v=math.max local j=math.pi local x=math.atan2 local D=Vector3.new local g=Vector2.new local T=CFrame.new local X=nil local k=nil local s=D(1,0,1)local r=D(0,0,0)local B=g(0,0)local i=nil local K=nil if E.TouchEnabled then K=H:GetClickToMoveFailStateChanged()end
-- Written By Kip Turner, Copyright Roblox 2014
-- Updated by Garnold to utilize the new PathfindingService API, 2017

local DEBUG_NAME = "ClickToMoveController"

local UIS = game:GetService("UserInputService")
local PathfindingService = game:GetService("PathfindingService")
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")
local DebrisService = game:GetService("Debris")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local tweenService = game:GetService("TweenService")

local Player = PlayerService.LocalPlayer
local PlayerScripts = Player.PlayerScripts

local CameraScript = script:FindFirstAncestor("CameraScript")
local InvisicamModule = nil
if CameraScript then
	InvisicamModule = require(CameraScript:WaitForChild("Invisicam"))
end

local MasterControlModule = script.Parent
local MasterControl = require(MasterControlModule)
local TouchJump = nil
if MasterControl then
	local TouchJumpModule = MasterControlModule:FindFirstChild("TouchJump")
	if TouchJumpModule then
		TouchJump = require(TouchJumpModule)
	end
end

local SHOW_PATH = true

local RayCastIgnoreList = workspace.FindPartOnRayWithIgnoreList

local math_min = math.min
local math_max = math.max
local math_pi = math.pi
local math_atan2 = math.atan2

local Vector3_new = Vector3.new
local Vector2_new = Vector2.new
local CFrame_new = CFrame.new

local CurrentSeatPart = nil
local DrivingTo = nil

local XZ_VECTOR3 = Vector3_new(1, 0, 1)
local ZERO_VECTOR3 = Vector3_new(0, 0, 0)
local ZERO_VECTOR2 = Vector2_new(0, 0)

local lastFailedPosition = nil

local BindableEvent_OnFailStateChanged = nil
if UIS.TouchEnabled then
	BindableEvent_OnFailStateChanged = MasterControl:GetClickToMoveFailStateChanged()
end
