Roblox/luau_corpus huggingface dataset:
--!strict
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type PredicateFunction<T> = (T, number, Array<T>) -> boolean

return function<T>(array: Array<T>, predicate: PredicateFunction<T>): number
	for i = 1, #array do
		local element = array[i]
		if predicate(element, i, array) then
			return i
		end
	end
	return -1
end
-- Set up the click event handlers for each button
for _, button in ipairs(dock:GetChildren()) do
	if button:IsA("ImageButton") then
		local appName = button.AppName
		appName.Visible = false

		button.MouseEnter:Connect(function()
			-- Show the AppName frame
			appName.Visible = true
		end)

		button.MouseLeave:Connect(function()
			-- Hide the AppName frame
			appName.Visible = false
		end)
	end
end
--[[Weight and CG]]
	Tune.Weight			= 700		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		4	,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .0		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-------AGAIN

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(21)

end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- << BANLAND >>
local banlandDe = true
function module:CreateBanland()
	coroutine.wrap(function()
	
		if not banlandDe then
			return
		else
			banlandDe = false
		end
		local totalY = 0
		if main.pdata.Rank < main.settings.ViewBanland then
			main:GetModule("cf"):ClearPage(pages.banland)
			local label = templates.banTitle:Clone()
			label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
			label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
			label.TextLabel.Text = "Must be rank '".. main:GetModule("cf"):GetRankName(main.settings.ViewBanland).."' or higher to view the Banland"
			label.Name = "TitleLabel"
			label.Visible = true
			label.Parent = pages.banland
		else
			
			--Retrieve Info
			local banlandInfo = main.signals.RetrieveBanland:InvokeServer()
			local canModifyBans = false
			if main.pdata.Rank >= (main.commandRanks.directban or 4) then
				canModifyBans = true
			end		
			
			--Clear labels
			main:GetModule("cf"):ClearPage(pages.banland)
			
			--Setup Labels
			local sectionNames = {"Current Server", "All Servers"}
			for section, records in pairs(banlandInfo) do
				--
				if #records > 0 then
					local label = templates.banTitle:Clone()
					label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
					label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
					label.TextLabel.Text = sectionNames[section]
					label.Name = "TitleLabel"
					totalY = totalY + templates.banTitle.AbsoluteSize.Y
					label.Visible = true
					label.Parent = pages.banland
				end
				--
				for i, record in pairs(records) do
					local userId = record.UserId
					if userId > 0 then
						totalY = totalY + templates.ban.AbsoluteSize.Y
						local settingsBan = record.SettingsBan
						local label = templates.ban:Clone()
						label.Name = "BanLabel"
						label.PlrName.Text = main:GetModule("cf"):GetName(userId)
						local banDateString
						local banTime = record.BanTime
						if tonumber(banTime) then
							banDateString = main:GetModule("cf"):GetBanDateString(os.date("*t", banTime))
						elseif settingsBan then
							banDateString = "Auto Settings Ban"
						else
							banDateString = "Infinite"
						end
						label.BanLength.Text = banDateString
						label.PlayerImage.Image = main:GetModule("cf"):GetUserImage(userId)
						label.BackgroundColor3 = main:GetModule("cf"):GetLabelBackgroundColor(i)
						local viewMore = label.ViewMore
						if canModifyBans and not settingsBan then
							viewMore.Visible = true
							viewMore.MouseButton1Down:Connect(function()
								main:GetModule("cf"):ShowBannedUser{label.PlrName.Text, userId, record.Reason, record.BannedBy}
							end)
						else
							viewMore.Visible = false
						end
						label.Visible = true
						label.Parent = pages.banland
					end
				end
			end
		
		
		end
		
		--Canvas Size
		pages.banland.CanvasSize = UDim2.new(0, 0, 0, totalY)
		
		banlandDe = true
	
	end)()
end

function module:UpdatePages()
	module:CreateServerRanks()
	module:CreateBanland()
	module:CreateRanks()
end
---------------
-- Variables --
---------------

local RunService = game:GetService('RunService')
local PlayersService = game:GetService('Players')
local Player = PlayersService.LocalPlayer

local Camera = nil
local Character = nil
local Torso = nil

local Mode = nil
local BehaviorFunction = nil

local childAddedConn = nil
local childRemovedConn = nil

local Behaviors = {} -- Map of modes to behavior fns
local SavedHits = {} -- Objects currently being faded in/out
local TrackedLimbs = {} -- Used in limb-tracking casting modes
--
for i = 1, 50 do
	wait(.1)
	bar.ImageTransparency = i/20+0.2
end

bar:Destroy()
--Internal functions
function DataStore:Debug(...)
	if self.debug then
		--print("[DataStore2.Debug]", ...)
	end
end

function DataStore:_GetRaw()
	if self.getRawPromise then
		return self.getRawPromise
	end

	self.getRawPromise = self.savingMethod:Get():andThen(function(value)
		self.value = value
		self:Debug("value received")
		self.haveValue = true
		self.getting = false
	end):catch(function(reason)
		self.getting = false
		self.getRawPromise = nil
		return Promise.reject(reason)
	end)

	return self.getRawPromise
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _, callback in ipairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
end
--
-- THESE ARE THE CORE SETTINGS
-- YOU WILL NOT BE ABLE TO CHANGE THEM IN-GAME
local Settings={
								--[[
Style Options
�������������					]]
Flat=false;						-- Enables Flat theme / Disables Aero theme
ForcedColor=false;				-- Forces everyone to have set color & transparency
Color=Color3.new(0,0,0);		-- Changes the Color of the user interface
ColorTransparency=.75;			-- Changes the Transparency of the user interface
Chat=false;						-- Enables the custom chat
BubbleChat=false;				-- Enables the custom bubble chat
								--[[
Basic Settings
��������������					]]
AdminCredit=true;				-- Enables the credit GUI for that appears in the bottom right
AutoClean=false;				-- Enables automatic cleaning of hats & tools in the Workspace
AutoCleanDelay=60;				-- The delay between each AutoClean routine
CommandBar=true;				-- Enables the Command Bar | GLOBAL KEYBIND: \
FunCommands=true;				-- Enables fun yet unnecessary commands
FreeAdmin=true;				-- Set to 1-5 to grant admin powers to all, otherwise set to false
PublicLogs=false;				-- Allows all users to see the command & chat logs
Prefix=':';						-- Character to begin a command
								--[[
Admin Powers
������������
0			Player
1			VIP					Can use nonabusive commands only on self
2			Moderator			Can kick, mute, & use most commands
3			Administrator		Can ban, crash, & set Moderators/VIP
4			SuperAdmin			Can grant permanent powers, & shutdown the game
5			Owner				Can set SuperAdmins, & use all the commands
6			Game Creator		Can set owners & use all the commands

Group & VIP Admin
�����������������
			You can set multiple Groups & Ranks to grant users admin powers
GroupAdmin={
[12345]={[254]=4,[253]=3};
[GROUPID]={[RANK]=ADMINPOWER}
};
			You can set multiple Assets to grant users admin powers
VIPAdmin={
[12345]=3;
[54321]=4;
[ITEMID]=ADMINPOWER;
};								]]

GroupAdmin={

};

VIPAdmin={

};

								--[[
Permissions
�����������
-- You can set the admin power required to use a command
-- COMMANDNAME=ADMINPOWER;		]]

Permissions={

};

}

return {Settings,{Owners,SuperAdmins,Admins,Mods,VIP,Banned}}
-- Advanced example, using promises to get points:
PointsService:GetPointsPromise():Then(function(points)
	print("Got points:", points)
end)

Knit.Start():Then(function()
	print("Knit running")
end):Catch(function(err)
	warn(err)
end)

wait(3)

CameraController:LockTo(workspace.SpawnLocation)

wait(6)

CameraController:Unlock()
--Updates the tach
val.RPM.Changed:connect(function()
	
	Guages.RPM.Text = tostring(math.floor(val.RPM.Value))
	
	--Updates the RPM Lights	
	local LightFraction = tostring(math.ceil(math.max(((val.RPM.Value - BeginRPM) / (MaxRPM - BeginRPM)) * 15,0)))
	
	print(LightFraction)
	
	Guages.RPM_LIGHTS[LightFraction].Visible = true
	
	for i = 1,15 do
		
		if tonumber(Guages.RPM_LIGHTS[i].Name) > tonumber(LightFraction)then
			
			Guages.RPM_LIGHTS[i].Visible = false
			
		end
		
	end
	
	
end)
--[[
    Changelog:
    - Add ExtraData and Attachments to gun instance data
]]

return function(Data)
    for _, Gun in pairs(Data.OwnedGuns) do
        if (not Gun.ExtraData) then
            Gun.ExtraData = {
                Attachments = {};
                XP = 0;
            }
        end
    end
end
--!strict
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
return function(value)
	return type(value) == "number" and value ~= math.huge and value == math.floor(value)
end
--[[
	Returns a new list with the new value replaced at the given index.
]]

local function replaceIndex(list, index, value)
	local new = {}
	local len = #list

	assert(index <= len, "index must be less or equal than the list length")

	for i = 1, len do
		if i == index then
			new[i] = value
		else
			new[i] = list[i]
		end
	end

	return new
end

return replaceIndex
--------AUDIENCE BACK RIGHT--------

game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackright1.Part2.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackright1.Part3.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackright1.Part5.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackright1.Part6.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackright1.Part8.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackright1.Part9.BrickColor = BrickColor.new(106)
--WARNING!
--DO NOT MODIFY THE CODE BELOW! (Unless you know what you're doing, in that case: Go nuts!)


local motor = script.Parent.Main.Base.HingeConstraint
local display = script.Parent.Display.SurfaceGui.TextLabel

local current_mode = 0


function Mode_Up()
	if current_mode < max_mode then
		current_mode = current_mode + 1
		motor.AngularVelocity = motor.AngularVelocity + increment_speed
		display.Text = current_mode
	end
end

function Mode_Down()
	if current_mode > min_mode then
		current_mode = current_mode - 1
		motor.AngularVelocity = motor.AngularVelocity - increment_speed
		display.Text = current_mode
	end
end


script.Parent.Button_Up.ClickDetector.mouseClick:connect(Mode_Up)
script.Parent.Button_Down.ClickDetector.mouseClick:connect(Mode_Down)
--[[
	Returns the existing instance of the specified `instanceType` with name
	`instanceName` that is a child of 'parent', otherwise that instance to
	return.
	
	This function is called when creating or obtaining the instance for the
	AvatarScreenGui or AssetsFolder used for MerchBooth.
]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Fetch the ID list
local IDList = require(script:FindFirstChildWhichIsA("ModuleScript"))
--yes i did put that thing there to hide how simple this is :)
--ignore
local CPSI = 0
local Values = script.Parent.Parent:FindFirstChild("A-Chassis Interface")
local Throttle = Values.Values.Throttle.Value
local CurrentGear = Values.Values.Gear.Value
local CurrentRPM = Values.Values.RPM.Value
local _Tune = require(car["A-Chassis Tune"])
local MaxRPM = _Tune.Redline
Values.Values.TPSI.Value = PSI
local DEADBOOST = PSI - 0.5
local active = false
local boom = true
--WeldRec(P.Parent.Lights)

for _,v in pairs(weldedParts) do
	if v:IsA("BasePart") then
		v.Anchored = false
	end
end
script.Parent.Keyscreen.Fob.Value = script.Parent
script:Destroy()
-- @Description Clamp a certain vector's magnitude to a Max
-- @Arg1 Vector
-- @Arg2 Max
function Basic.ClampMagnitude(v, max)
	return v.Unit * math.min(v.Magnitude, max)
end
--[[
    Chooses between the different GuiTypes that the emotes can be displayed in
]]

local Roact = require(script.Parent.Parent.Packages.Roact)
local t = require(script.Parent.Parent.Packages.t)
local configs = require(script.Parent.Parent.config)
local ConfigurationContext = require(script.Parent.Parent.DevModuleConfig.ConfigurationContext)
local enums = require(script.Parent.Parent.enums)
local EmoteBar = require(script.Parent.EmoteBar)
local EmoteWheelBillboard = require(script.Parent.EmoteWheelBillboard)

local EmoteView = Roact.Component:extend("EmoteView")

EmoteView.defaultProps = {
	isVisible = true,
	forceHide = false,
}

EmoteView.validateProps = t.strictInterface({
	forceHide = t.boolean,
	isVisible = t.boolean,
	configuration = configs.client.validate,
})

function EmoteView:render()
	local guiType = self.props.configuration.guiType

	if guiType == enums.GuiType.EmoteBar then
		return Roact.createElement(EmoteBar, {
			isVisible = self.props.isVisible and not self.props.forceHide,
		})
	elseif guiType == enums.GuiType.EmoteWheel then
		return Roact.createElement(EmoteWheelBillboard, {
			isVisible = self.props.isVisible,
		})
	end
end

return ConfigurationContext.withConfiguration(EmoteView)
--Weld stuff here


unit.MainSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)
--[[Rear]]--
	Tune.RTireProfile	= 1			-- Tire profile, aggressive or smooth
	Tune.RProfileHeight	= .45		-- Profile height, conforming to tire
	
	Tune.RTireCompound	= 2			-- The more compounds you have, the harder your tire will get towards the middle, sacrificing grip for wear
	Tune.RTireFriction	= 1.8		-- Your tire's friction in the best conditions.
-- Get all possible gamepasses
for i,v in pairs(Tycoon:WaitForChild('Buttons'):GetChildren()) do
	if v:FindFirstChild('Gamepass') then
		if v.Gamepass.Value > 0 then
			GamePasses[v.Gamepass.Value] = v -- the button
		end
	end
end

MarketplaceService.ProcessReceipt = function(receiptInfo)
	for i,plr in pairs(game.Players:GetPlayers()) do
		if plr.userId == receiptInfo.PlayerId then
			if DevProducts[receiptInfo.ProductId] then
				for p,b in pairs(script.Parent.Tycoons[plr.team.name]:WaitForChild('Buttons'):GetChildren()) do
					if b:FindFirstChild('DevProduct') then
						if b.DevProduct.Value == receiptInfo.ProductId then
							local PlrT = game.ServerStorage.PlayerMoney:WaitForChild(plr.Name).OwnsTycoon
							if PlrT.Value ~= nil then
								local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name)
								Create({[1] = 0,[2] = b,[3] = PlayerStats}, PlrT.Value.BuyObject)
							end
                            break
						end
					end
				end
			end
		end
	end
end

local function gamepassPurchaseFinished(player,gamepass,bought)
	if bought then
		for i,plr in pairs(game.Players:GetPlayers()) do
			if plr.userId == player.userId then
				if GamePasses[gamepass] then
					for p,b in pairs(script.Parent.Tycoons[plr.team.name]:WaitForChild('Buttons'):GetChildren()) do
						if b:FindFirstChild('Gamepass') then
							if b.Gamepass.Value == gamepass then
								local PlrT = game.ServerStorage.PlayerMoney:WaitForChild(plr.Name).OwnsTycoon
								if PlrT.Value ~= nil then
									local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name)
									Create({[1] = 0,[2] = b, [3] = PlayerStats}, PlrT.Value.BuyObject)
								end
                            	break
							end
						end
					end
				end
			end
		end
	end
end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(gamepassPurchaseFinished)

function Create(tab, prnt)
	local x = Instance.new('Model')
	Instance.new('NumberValue',x).Value = tab[1]
	x.Value.Name = "Cost"
	Instance.new('ObjectValue',x).Value = tab[2]
	x.Value.Name = "Button"
	local Obj = Instance.new('ObjectValue',x)
	Obj.Name = "Stats"
	Obj.Value = tab[3]
	x.Parent = prnt
end
--!nonstrict
--[[ Constants ]]--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png"

local DYNAMIC_THUMBSTICK_ACTION_NAME = "DynamicThumbstickAction"
local DYNAMIC_THUMBSTICK_ACTION_PRIORITY = Enum.ContextActionPriority.High.Value

local MIDDLE_TRANSPARENCIES = {
	1 - 0.89,
	1 - 0.70,
	1 - 0.60,
	1 - 0.50,
	1 - 0.40,
	1 - 0.30,
	1 - 0.25
}
local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES

local FADE_IN_OUT_BACKGROUND = true
local FADE_IN_OUT_MAX_ALPHA = 0.35

local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3
local FADE_IN_OUT_BALANCE_DEFAULT = 0.5
local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

local LocalPlayer = Players.LocalPlayer
if not LocalPlayer then
	Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	LocalPlayer = Players.LocalPlayer
end
-- Decompiled with the Synapse X Luau decompiler.

return {
	Name = "blink", 
	Aliases = { "b" }, 
	Description = "Teleports you to where your mouse is hovering.", 
	Group = "DefaultDebug", 
	Args = {}, 
	ClientRun = function(p1)
		local l__Character__1 = p1.Executor.Character;
		if not l__Character__1 then
			return "You don't have a character.";
		end;
		l__Character__1:MoveTo(p1.Executor:GetMouse().Hit.p);
		return "Blinked!";
	end
};
-- Load Roblox Camera Controller Modules
local ClassicCamera = require(script:WaitForChild("ClassicCamera"))
local OrbitalCamera = require(script:WaitForChild("OrbitalCamera"))
local LegacyCamera = require(script:WaitForChild("LegacyCamera"))
-- functions

return function(character, boost)
	local upperTorso	= character.UpperTorso
	
	local icon		= script[boost].IconEmitter:Clone()
		icon.Parent		= upperTorso
	local spark		= script[boost].SparkEmitter:Clone()
		spark.Parent	= upperTorso
		
	--[[local sound		= script[boost .. "Sound"]:Clone()
		sound.Parent	= upperTorso]]
	
	icon:Emit(10)
	spark:Emit(25)
	--sound:Play()
		
	Debris:AddItem(icon, 2)
	Debris:AddItem(spark, 2)
	--Debris:AddItem(sound, sound.TimeLength)
end
-- xSIXx, Create an animatable joint when tool is equipped.








local motorName = "Handle" -- Change this to the target Motor6D name you want in the Right Arm/RightHand.
-- This finds the Aircraft that we are controlling
Parts = game.Players.LocalPlayer:FindFirstChild("Turret").Value;
VehicleStats = Parts.Stats;
local Settings = require(Parts.Parent.VehicleSettings)

function move(point, engine)
	local origincframe = engine:findFirstChild("BodyGyro").cframe
	local size = engine.Parent.Parent:GetExtentsSize()
	local target = engine.Position+((point - engine.Position).unit*100)
	local dir = (target - engine.Position).unit
	local spawnPos = engine.Position
	local left = engine.CFrame*CFrame.new(-size.x/2, 0, 0).p
	local right = engine.CFrame*CFrame.new(size.x/2, 0, 0).p
	local md = (target - engine.Position).magnitude

	local foebmd = engine.CFrame*CFrame.new(0, 0, -md).p
	local toleft = (target -left).magnitude
	local toright = (target -right).magnitude
	local rot = ((foebmd - target).magnitude/10)
	local pos = spawnPos + (dir * 1)
	local turn = math.rad((rot/10)*Settings.TiltFactor)
	if turn > math.rad(89) then
	turn = math.rad(89)
	end
	if toleft< toright and toleft >rot then
		engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos,  (pos + dir))*CFrame.fromEulerAnglesXYZ(0, 0, turn)
	elseif toleft > toright and toright >rot then
		engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos,  (pos + dir))*CFrame.fromEulerAnglesXYZ(0, 0, -turn)
	else
		engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos,  -(pos + dir))
	end
	engine:findFirstChild("BodyGyro").P = Settings.TurnSpeed
end

function onMouseMove(mouse)
-- <Region> CreateRegion(<Vector3> Center, <Vector3> Rotation, <Vector3> Size)
	--Creates Region with specific input
	--Returns <Region>
local function CreateRegion(Center, Rotation, Size)
	local Region = {}
		Region.Center = Center or Vector3.new(0, 0, 0)
		Region.Rotation = Rotation or Vector3.new(0, 0, 0)
		Region.Size = Size or Vector3.new(0, 0, 0)
		function Region:isInRegion(Part)
			return isInRegion(Region, Part)
		end
		function Region:isInRegionIgnoreY(Part)
			return isInRegionIgnoreY(Region, Part)
		end

	return Region
end