Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Enemy constructor


function Enemy.new(enemyType, location, target, difficulty)
	assert(enemies[enemyType], "Invalid enemy type")
	
	local self = setmetatable({}, Enemy)
	
	self._model = enemies[enemyType]:Clone()	
	
	-- Disable unnecessary behaviors of humanoid to make game more efficient
	self._model.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
	self._model.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
	self._model.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
	
	-- Set enemy health based on difficulty
	self._model.Humanoid.MaxHealth = GameSettings.EnemyHealthDifficulty[difficulty]
	self._model.Humanoid.Health = GameSettings.EnemyHealthDifficulty[difficulty]
	
	-- Tag the enemy's model
	CollectionService:AddTag(self._model, "Enemy")
	
	self._model.Humanoid.Died:Connect(function()
		self:_destroy()
	end)
	
	self._model.HumanoidRootPart.Touched:Connect(function(otherPart) 
		self:_onTouch(otherPart)
	end)
	
	self._target = target
	self._active = false
	
	self._model:SetPrimaryPartCFrame(location)
	self._model.Parent = game.Workspace.Targets
	
	return self
end

function Enemy:_update()
	if self._model and self._model:FindFirstChild("Humanoid") then
		local targetPosition = self._target.PrimaryPart.Position
		local targetVelocity = self._target.PrimaryPart.AssemblyLinearVelocity
		local predictedPosition = targetPosition + targetVelocity * 4
		self._model.Humanoid:MoveTo(targetPosition)
	end
end
--[[
	The 'smarter' version of `cleanupOnDestroy` - this attempts to match the
	results from the 'dumber' polling-based version by using events to reduce
	processing.

	I'd like to improve this technique in the future - it breaks in a fair few
	edge cases right now, so in the interest of stability I don't want to adopt
	it yet.
]]



local RunService = game:GetService("RunService")

local Package = script.Parent.Parent
local cleanup = require(Package.Utility.cleanup)
-- returns the tangent vector in the direction of the path made by the bezier at t (where t is relative to the length of the Bezier Curve)
-- does not work if the bezier does not have at least 2 points
-- the given t value must be between 0 and 1


function Bezier:CalculateDerivativeRelativeToLength(t: number): Vector3
	
	-- check if t is a number between 0 and 1
	if type(t) ~= "number" then
		error("Bezier:CalculateDerivativeRelativeToLength() only accepts a number, got " .. tostring(t) .. "!")
	end
	
	-- start algorithm to calculate derivative in bezier
	local points = self.Points
	local numPoints = #points
	
	-- check if there are at least 2 points
	if numPoints > 1 then
		
		-- important values
		local length = self.Length
		local lengthIndeces = self.LengthIndeces
		local iterations = self.LengthIterations
		local points = self:GetAllPoints()

		-- get length of bezier
		local targetLength = length * t

		-- iterate through sum table
		local nearestParameterIndex, nearestParameter
		for i, orderedPair in ipairs(lengthIndeces) do
			if targetLength - orderedPair[2] <= 0 then
				nearestParameterIndex = i
				nearestParameter = orderedPair
				break
			elseif i == #lengthIndeces then
				nearestParameterIndex = i
				nearestParameter = orderedPair
				break
			end
		end

		-- calculate percent error
		local d0, d1
		if lengthIndeces[nearestParameterIndex - 1] then
			d0, d1 = self:CalculateDerivativeAt(lengthIndeces[nearestParameterIndex - 1][1]), self:CalculateDerivativeAt(nearestParameter[1])
		else
			d0, d1 = self:CalculateDerivativeAt(nearestParameter[1]), self:CalculateDerivativeAt(lengthIndeces[nearestParameterIndex + 1][1])
		end
		local percentError = (nearestParameter[2] - targetLength) / (d1 - d0).Magnitude

		-- return the derivative at the nearestParameter
		return d0 + (d1 - d0) * (1 - percentError)
	else
		
		-- not enough points to calculate derivative
		error("Bezier:CalculateDerivativeRelativeToLength() only works if there are at least 2 BezierPoints!")
	end
end
--[=[
	Merges the new data into the original value

	@param original table?
	@return table -- The original table
]=]


function DataStoreWriter:WriteMerge(original)
	original = original or {}

	for key, value in pairs(self._rawSetData) do
		if value == DataStoreDeleteToken then
			original[key] = nil
		else
			original[key] = value
		end
	end

	for key, writer in pairs(self._writers) do
		if self._rawSetData[key] ~= nil then
			warn(("[DataStoreWriter.WriteMerge] - Overwritting key %q already saved as rawData with a writer")
				:format(tostring(key)))
		end

		local result = writer:WriteMerge(original[key])
		if result == DataStoreDeleteToken then
			original[key] = nil
		else
			original[key] = result
		end
	end

	return original
end

return DataStoreWriter
--[[Weight and CG]]


	Tune.Weight			= 1000		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensionws in studs ; larger = more stable)
	 --[[Width]]		6.5		,
	 --[[Height]]		4.8		,
	 --[[Length]]		17		}
	Tune.WeightDist		= 51		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .7		-- 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
--!nonstrict
-- Roblox character sound script



local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local AtomicBinding = require(script:WaitForChild("AtomicBinding"))

local function loadFlag(flag: string)
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled(flag)
	end)
	return success and result
end

local SOUND_DATA : { [string]: {[string]: any}} = {
	Climbing = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
		Looped = true,
	},
	Died = {
		SoundId = "",
	},
	FreeFalling = {
		SoundId = "",
		Looped = true,
	},
	GettingUp = {
		SoundId = "",
	},
	Jumping = {
		SoundId = "",
	},
	Landing = {
		SoundId = "",
	},
	Running = {
		SoundId = "",
		Looped = true,
		Pitch = 1.85,
	},
	Splash = {
		SoundId = "",
	},
	Swimming = {
		SoundId = "",
		Looped = true,
		Pitch = 1.6,
	},
}
--Made by Luckymaxer



Model = script.Parent

Creator = Model:FindFirstChild("Creator")

Enabled = false

wait(1)

if Creator and Creator.Value and Creator.Value.Parent and Creator.Value:IsA("Player") and Creator.Value.Character then
	Player = Creator.Value
	Character = Player.Character
	Humanoid = Character:FindFirstChild("Humanoid")
	if Humanoid and Humanoid.Health > 0 then
		Player.Changed:connect(function(Property)
			if Property == "Parent" and not Player.Parent then
				Model:Destroy()
			end
		end)
		Character.Changed:connect(function(Property)
			if Property == "Parent" and not Character.Parent then
				Model:Destroy()
			end
		end)
		Humanoid.Died:connect(function()
			Model:Destroy()
		end)
		Enabled = true
	end
end

if not Enabled then
	Model:Destroy()
end
----------------------------------------------------------------------------------------------------
------------------=[ Status UI ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,EnableStatusUI = false				--- Don't disabled it...
	,RunWalkSpeed = 22
	,NormalWalkSpeed = 16
	,SlowPaceWalkSpeed = 8	
	,CrouchWalkSpeed = 8
	,ProneWalksSpeed = 4

	,EnableHunger = false				--- Hunger and Thirst system
	,HungerWaitTime = 25

	,CanDrown = true 					--- Welp.. That's it
	
	,EnableStamina = true 				--- Weapon Sway based on stamina	
	,RunValue = 1						--- Stamina consumption
	,StandRecover = .25					--- Stamina recovery while stading
	,CrouchRecover = .5					--- Stamina recovery while crouching
	,ProneRecover = 1					--- Stamina recovery while lying

	,EnableGPS = false					--- GPS shows your allies around you
	,GPSdistance = 150

	,InteractionMenuKey = Enum.KeyCode.LeftControl
--This module is for any client FX related to the first door on the left.



local DoorFX = {}

local tweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)

function DoorFX.OPEN(door)
	if not door then return end
	
	tweenService:Create(door.Door.Main, tweenInfo, {CFrame = door.Door.Goal.CFrame}):Play()

	door.Door.Main.DoorOpenFADEOUT:Play()
end

function DoorFX.CLOSE(door)
	if not door then return end

	door.Door.Main.CFrame = door.Door.Home.CFrame
end

return DoorFX
--light setup!--


local mod = pln:findFirstChild("Lights")
for i,v in pairs(mod:GetChildren()) do 
mod:findFirstChild("FlashScript").Disabled = true
if(v.className == "Part") then 
if(v:findFirstChild("Gui").Enabled == true) then 
v:findFirstChild("Gui").Enabled = false
end
if(v:findFirstChild("Gui").Adornee == nil) then 
v:findFirstChild("Gui").Adornee = v:findFirstChild("Gui").Parent
end end end
--[=[
	Creates an immediately resolved Promise with the given value.

	```lua
	-- Example using Promise.resolve to deliver cached values:
	function getSomething(name)
		if cache[name] then
			return Promise.resolve(cache[name])
		else
			return Promise.new(function(resolve, reject)
				local thing = getTheThing()
				cache[name] = thing

				resolve(thing)
			end)
		end
	end
	```

	@param ... any
	@return Promise<...any>
]=]


function Promise.resolve(...)
	local length, values = pack(...)
	return Promise._new(debug.traceback(nil, 2), function(resolve)
		resolve(unpack(values, 1, length))
	end)
end
--			dir = newdir 


			--dir = dir.unit 
			--newBV.velocity = dir * 32 
		--end

		--newBG.cframe = CFrame.new(torso.Position, target*Vector3.new(1,0,1) + Vector3.new(0, torso.Position.Y, 0) ) * CFrame.Angles(-math.pi/2, 0, 0)

		--wait(.1)
	--end
	-- end of testing for fun


	--for i = 1, 3 do
--[[Drivetrain Initialize]]



	local Drive={}
	
	--Power Front Wheels
	if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
				table.insert(Drive,v)
			end
		end
	end
	
	--Power Rear Wheels
	if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
				table.insert(Drive,v)
			end
		end
	end
	
	--Determine Wheel Size
	local wDia = 0
	for i,v in pairs(Drive) do
		if v.Size.x>wDia then wDia = v.Size.x end
	end
	
	--Pre-Toggled PBrake
	for i,v in pairs(car.Wheels:GetChildren()) do
		if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then
			_PBrake=true
		end
	end
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



local damagetime
local damagedb = false

for _, zambieparts in pairs(zombie:GetChildren())do
	if zambieparts:IsA'Part' and human.Health > 0 then
		zambieparts.Touched:connect(function(p)
			if p.Parent.Name == chaseName and p.Parent.Name ~= zombie.Name and not damagedb then -- damage
				damagedb = true
				damagetime = time()
				local enemy = p.Parent
				local enemyhuman = getHumanoid(enemy)
				vars.Attacking.Value = true
				enemyhuman.WalkSpeed = 0
				local animation = script.Parent.Zombie:LoadAnimation(script.Parent.Attack)
				animation:Play()
				script.Parent.HumanoidRootPart.Theme:Stop()
				head.Jumpscare:Play()
				wait(0.83)
				head.Hit2:Play()
				enemyhuman:TakeDamage(ZombieDamage)
				wait(1)
				script.Parent.HumanoidRootPart.Theme:Play()
				vars.Attacking.Value = false
				while wait() do
					if damagetime ~= nil and time() >= (damagetime + DamageWait) then
						damagedb = false
						damagetime = nil
					end
				end
			end
		end)
	end
end
-- headless


local function onPlayerChatted(player, message)
	if message == '/headless' and player.Character and player.Character:FindFirstChild("Head") then
		player.Character.Head.Transparency = 1
		player.Character.Head.face.Transparency = 1
		end
	end
local function onPlayerAdded(player)
	player.Chatted:Connect(function (message) onPlayerChatted(player, message) end)
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
--


tool.Equipped:connect(function()
	equipped = true
	owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
	character = owner.Character
	local rightarm = Instance.new("Weld", character.Torso)
	rightarm.Part0 = character.Torso
	rightarm.Part1 = character["Right Arm"]
	rightarm.C0 = CFrame.new(1.5,0,0)
	rightarm.Name = "RightArmWeldpunch"
	local leftarm = Instance.new("Weld", character.Torso)
	leftarm.Part0 = character.Torso
	leftarm.Part1 = character["Left Arm"]
	leftarm.C0 = CFrame.new(-1.5,0,0)
	leftarm.Name = "LeftArmWeldpunch"
	local head = Instance.new("Weld", character.Torso)
	head.Part0 = character.Torso
	head.Part1 = character.Head
	head.C0 = CFrame.new(0,1.5,0)
	head.Name = "HeadWeldpunch"
	local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart)
	humanoidrootpart.Part0 = character.HumanoidRootPart
	humanoidrootpart.Part1 = character.Torso
	humanoidrootpart.Name = "HumanoidRootPartWeldpunch"
	for i,v in pairs(script:GetChildren()) do
		if v.ClassName == "Sound" then
			v.Parent = character.HumanoidRootPart
		end
	end
	cananimate = true
	local savedchar = character
	local lasthp = character:findFirstChildOfClass("Humanoid").Health
	coroutine.wrap(function()
		local humhp = character:findFirstChildOfClass("Humanoid").Health
		while runservice.Stepped:wait() and equipped do
			if character:findFirstChildOfClass("Humanoid").Health < humhp then
				local thedamage = humhp - character:findFirstChildOfClass("Humanoid").Health
				character:findFirstChildOfClass("Humanoid").Health = character:findFirstChildOfClass("Humanoid").Health - thedamage / 10

			end
			if cananimate then
				head.C0 = head.C0:lerp(CFrame.new(0,1.5,0),0.1)
				humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.2)
				leftarm.C0 = leftarm.C0:lerp(CFrame.new(-0.8,0.15,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi-(math.rad(20)),0,math.rad(15)) * CFrame.new(0,-0.1,0),0.2)
				rightarm.C0 = rightarm.C0:lerp(CFrame.new(0.8,0.15,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi-(math.rad(20)),0,math.rad(-15)) * CFrame.new(0,-0.1,0),0.2)
			end
			humhp = character:findFirstChildOfClass("Humanoid").Health
		end
	end)()
end)

tool.Unequipped:connect(function()
	equipped = false
	instancewhitelist = {}
	mouseclick = false
	cananimate = false
	for i,v in pairs(character.HumanoidRootPart:GetChildren()) do
		if v.ClassName == "Sound" then
			v.Parent = script
		end
	end
	if character.Torso:findFirstChild("LeftArmWeldpunch") then
		character.Torso:findFirstChild("LeftArmWeldpunch"):destroy()
	end
	if character.Torso:findFirstChild("RightArmWeldpunch") then
		character.Torso:findFirstChild("RightArmWeldpunch"):destroy()
	end
	if character.Torso:findFirstChild("HeadWeldpunch") then
		character.Torso:findFirstChild("HeadWeldpunch"):destroy()
	end
	if character:findFirstChild("HumanoidRootPart") then
		if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldpunch") then
			character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldpunch"):destroy()
		end
	end
end)
--[[Engine]]



	--		[TORQUE CURVE VISUAL]
	--		https://www.desmos.com/calculator/nap6stpjqf
	--		Use sliders to manipulate values
	--		Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
	
	Tune.Horsepower		= 250
	Tune.IdleRPM		= 700
	Tune.PeakRPM		= 6000
	Tune.Redline		= 7000
	Tune.EqPoint		= 5252
	Tune.PeakSharpness	= 20
	Tune.CurveMult		= 0.2
	
	Tune.InclineComp	= 1.2		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Turbo Settings
	Tune.Aspiration		= "Super"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger
		"Super"			: Supercharger												]]
	
	Tune.Boost			= 5			--Max PSI (If you have two turbos and this is 15, the PSI will be 30)
	Tune.TurboSize		= 80		--Turbo size; the bigger it is, the more lag it has.
	Tune.CompressRatio	= 9			--The compression ratio (look it up)
	Tune.Sensitivity	= 0.05		--How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1)
	
	--Misc
	Tune.RevAccel		= 300		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 250		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--[=[
	Requires all the modules that are children of the given parent. This is an easy
	way to quickly load all controllers that might be in a folder.
	```lua
	Knit.AddControllers(somewhere.Controllers)
	```
]=]


function KnitClient.AddControllers(parent: Instance): {Controller}
	local addedControllers = {}
	for _,v in ipairs(parent:GetChildren()) do
		if not v:IsA("ModuleScript") then continue end
		table.insert(addedControllers, require(v))
	end
	return addedControllers
end
--Green for Friendly, and Red for foe's. Kind of like the type Pinkyblt and Griff27 uses in thier games.



bin = script.Parent
normel = "http://www.roblox.com/asset/?id=7419350"
friendly = "http://www.roblox.com/asset/?id=7419364"
enemy = "http://www.roblox.com/asset/?id=7419379"
function Run(mouse)
	mouse.Icon = normel
	local hit = mouse.Target
	if (hit == nil) then return end
        h = hit.Parent:FindFirstChild("Humanoid")
        if h ~= nil then
        torso = hit.Parent.Torso
        if torso ~= nil then
        if h.Health > 0 then
	if (torso.BrickColor == bin.Parent.Torso.BrickColor) then
        mouse.Icon = friendly
        elseif torso.BrickColor ~= bin.Parent.Torso.BrickColor then
        mouse.Icon = enemy
        end
        end
        end
        
	end
end







function on(mouse)
        while true do
        wait()
	Run(mouse)
        end
end



script.Parent.Equipped:connect(on)
--[[
	Used to set a handler for when the promise resolves, rejects, or is
	cancelled. Returns a new promise chained from this promise.
]]


function Promise.prototype:_finally(traceback, finallyHandler, onlyOk)
	if not onlyOk then
		self._unhandledRejection = false
	end

	-- Return a promise chained off of this promise
	return Promise._new(traceback, function(resolve, reject)
		local finallyCallback = resolve
		if finallyHandler then
			finallyCallback = createAdvancer(
				traceback,
				finallyHandler,
				resolve,
				reject
			)
		end

		if onlyOk then
			local callback = finallyCallback
			finallyCallback = function(...)
				if self._status == Promise.Status.Rejected then
					return resolve(self)
				end

				return callback(...)
			end
		end

		if self._status == Promise.Status.Started then
			-- The promise is not settled, so queue this.
			table.insert(self._queuedFinally, finallyCallback)
		else
			-- The promise already settled or was cancelled, run the callback now.
			finallyCallback(self._status)
		end
	end, self)
end
--[=[
	Extracts the locale from the name

	@param tableName string -- Used for source
	@param localeId string -- the defaultlocaleId
	@param dataTable table -- Data table to load from
	@return LocalizationTable
]=]


function JsonToLocalizationTable.loadTable(tableName, localeId, dataTable)
	assert(type(tableName) == "string", "Bad tableName")

	local localizationTable = JsonToLocalizationTable.getOrCreateLocalizationTable()

	recurseAdd(localizationTable, localeId, "", dataTable, tableName)

	return localizationTable
end
------------------------







local maincf = CFrame.new(0, 0, 0)  

	
	
	equip = true
	arms = VMS:WaitForChild("v_FlashlightV2"):Clone()

	arms.HumanoidRootPart.SpotLight.Brightness = brightness
	arms.HumanoidRootPart.SpotLight.Range = range
	arms.HumanoidRootPart.SpotLight.Shadows = shadowson

	arms.Parent = cam
	arms.Name = "Arms"
	

	
	run.RenderStepped:Connect(function()
		if equip == true and arms then
			arms:SetPrimaryPartCFrame(
				cam.CFrame
				* maincf

				

			)
			


		end
	end)
	


UIS.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode[FlashlightKey] and equip == true then
		if ison == true then
			ison = false
			arms.HumanoidRootPart.SpotLight.Enabled = false
			FlashlightGui.FlashlightOn.Visible = false
			FlashlightGui.FlashlightOff.Visible = true
			arms.HumanoidRootPart.Flashlightss:Play()
			

		else
			ison = true
			arms.HumanoidRootPart.SpotLight.Enabled = true
			FlashlightGui.FlashlightOff.Visible = false
			FlashlightGui.FlashlightOn.Visible = true
			arms.HumanoidRootPart.Flashlightss:Play()
			

		end
	end
end)


local de = true
function onButtonPress()
	if de == true and equip == true then
		de = false
		if ison == true then
			ison = false
			arms.HumanoidRootPart.SpotLight.Enabled = false
			FlashlightGui.FlashlightOn.Visible = false
			FlashlightGui.FlashlightOff.Visible = true
			arms.HumanoidRootPart.Flashlightss:Play()


		else
			ison = true
			arms.HumanoidRootPart.SpotLight.Enabled = true
			FlashlightGui.FlashlightOff.Visible = false
			FlashlightGui.FlashlightOn.Visible = true
			arms.HumanoidRootPart.Flashlightss:Play()

		end
		
		wait(.75)
		de = true
	end
end


Con:SetImage("FlashLight", "rbxassetid://2883826635")	

Con:BindAction("FlashLight",onButtonPress,true,"F")



	
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
	equip = false
	ison = false
	arms:Destroy()
end)
--Make the part move left and right


local function movePart()
	local speed = 3
	local direction = 1
	
	while true do
		wait(0.1)
		
		if parentPart.Position.X > 5 then
			direction = -1
		elseif parentPart.Position.X < -5 then
			direction = 1
		end
		
		parentPart.Position += Vector3.new(speed * direction, 0, 0)
	end	
end
--[[ Local Functions ]]

--
local function onShiftLockToggled()
	IsShiftLocked = not IsShiftLocked
	if IsShiftLocked then
		ShiftLockIcon.Image = SHIFT_LOCK_ON
		Mouse.Icon = SHIFT_LOCK_CURSOR
		UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
	else
		ShiftLockIcon.Image = SHIFT_LOCK_OFF
		Mouse.Icon = ""
		UserInputService.MouseBehavior = Enum.MouseBehavior.Default
	end
end

local function initialize()
	if ScreenGui then
		ScreenGui:Destroy()
		ScreenGui = nil
	end
	ScreenGui = Instance.new('ScreenGui')
	ScreenGui.Name = "ControlGui"
	
	local frame = Instance.new('Frame')
	frame.Name = "BottomLeftControl"
	frame.Size = UDim2.new(0, 130, 0, 46)
	frame.Position = UDim2.new(0, 0, 1, -46)
	frame.BackgroundTransparency = 1
	frame.Parent = ScreenGui
	
	ShiftLockIcon = Instance.new('ImageButton')
	ShiftLockIcon.Name = "MouseLockLabel"
	ShiftLockIcon.Size = UDim2.new(0, 62, 0, 62)
	ShiftLockIcon.Position = UDim2.new(0, 2, 0, -65)
	ShiftLockIcon.BackgroundTransparency = 1
	ShiftLockIcon.Image = IsShiftLocked and SHIFT_LOCK_ON or SHIFT_LOCK_OFF
	ShiftLockIcon.Visible = IsShiftLockMode
	ShiftLockIcon.Parent = frame
	
	ShiftLockIcon.MouseButton1Click:connect(onShiftLockToggled)
	
	ScreenGui.Parent = PlayerGui
end