Roblox/luau_corpus huggingface dataset:
-- reference documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
local charCodeAt = require(script.Parent.String.charCodeAt)
local Error = require(script.Parent.Error)
local HttpService = game:GetService("HttpService")

local function encodeURIComponent(value: string): string
	local valueLength = utf8.len(value)
	if valueLength == 0 or valueLength == nil then
		return ""
	end
	-- we don't exhaustively test the whole string for invalid characters like ECMA-262 15.1.3 says
	local check = charCodeAt(value, 1)
	if valueLength == 1 then
		if check == 0xD800 then
			error(Error.new("URI malformed"))
		end
		if check == 0xDFFF then
			error(Error.new("URI malformed"))
		end
	end
	if check >= 0xDC00 and check < 0xDFFF then
		error(Error.new("URI malformed"))
	end
	local encoded = HttpService:UrlEncode(value)
	-- reverting encoded chars which are not encoded by JS
	local result = encoded
		:gsub("%%2D", "-")
		:gsub("%%5F", "_")
		:gsub("%%2E", ".")
		:gsub("%%21", "!")
		:gsub("%%7E", "~")
		:gsub("%%2A", "*")
		:gsub("%%27", "'")
		:gsub("%%28", "(")
		:gsub("%%29", ")")
	return result
end

return encodeURIComponent
-- places a brick at pos and returns the position of the brick's opposite corner
function placeBrick(cf, pos, color)
	local brick = Instance.new("Part")
	brick.BrickColor = color
	brick.CFrame = cf * CFrame.new(pos + brick.size / 2)
	brick.Parent = script.Parent.Bricks
	brick:makeJoints()
	return  brick, pos +  brick.size
end

function buildWall(cf)

	local color = BrickColor.random()
	local bricks = {}

	assert(wallWidth>0)
	local y = 0
	while y < wallHeight do
		local p
		local x = -wallWidth/2
		while x < wallWidth/2 do
			local brick
			brick, p = placeBrick(cf, Vector3.new(x, y, 0), color)
			x = p.x
			table.insert(bricks, brick)
			wait(brickSpeed)
		end
		y = p.y
	end

	wait(wallLifetime)

	-- now delete them!
	while #bricks>0 do
		table.remove(bricks):Remove()
		task.wait(brickSpeed/2)
	end

end

script.Parent.ChildAdded:connect(function(item)
	if item.Name=="NewWall" then
		item:remove()
		buildWall(item.Value)
	end
end)
-- FIXME Luau: typing class as Object gives: Type '{ @metatable {| __call: <a>(a, ...any) -> Error, __tostring: <b, c>({+ message: b, name: c +}) -> string |}, Error }' could not be converted into 'table'
return function(tbl: any, class: any): boolean
	if _G.__DEV__ then
		assert(typeof(class) == "table", "Received a non-table as the second argument for instanceof")
	end

	if typeof(tbl) ~= "table" then
		return false
	end

	local ok, hasNew = pcall(function()
		return class.new ~= nil and tbl.new == class.new
	end)
	if ok and hasNew then
		return true
	end

	local seen = { tbl = true }

	while tbl and typeof(tbl) == "table" do
		tbl = getmetatable(tbl)
		if typeof(tbl) == "table" then
			tbl = tbl.__index

			if tbl == class then
				return true
			end
		end

		-- if we still have a valid table then check against seen
		if typeof(tbl) == "table" then
			if seen[tbl] then
				return false
			end
			seen[tbl] = true
		end
	end

	return false
end
-- Hands
character.LeftHand.Material = Material
character.RightHand.Material = Material
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 60 -- cooldown for use of the tool again

ZoneModelName = "worst beauty" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--[[Susupension]]
	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= true			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Hot pink"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- find player's head pos

	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local head = vCharacter:findFirstChild("Head")
	if head == nil then return end

	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 5 * dir

	local delta = mouse_pos - launch
	
	local dy = delta.y
	
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit
	
	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	local theta = computeLaunchAngle( dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz
	

	local missile = Pellet:clone()

	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	missile.Bomb.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace

	missile:SetNetworkOwner(vPlayer)

end


function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end




Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	local targetPos = script.Parent.Info:InvokeClient((game.Players:GetPlayerFromCharacter(character)), true) -- humanoid.TargetPoint

	fire(targetPos)

	wait(.2)

	Tool.Enabled = true
end

script.Parent.Activated:connect(onActivated)
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	plrData.Money.Gold.Value = plrData.Money.Gold.Value - 100 -- TODO track for dissertation
	local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
	ClassInformationTable:GetClassFolder(player,"Mage").Obtained.Value = true
	ClassInformationTable:GetClassFolder(player,"Mage").Glacies.Value = true
	
end
-- << CHATTING >>
main.chatting = false
main.userInputService.TextBoxFocused:connect(function()
	main.chatting = true
end)
main.userInputService.TextBoxFocusReleased:connect(function()
	main.chatting = false
end)
--]]


function getHumanoid(model)
	for _, v in pairs(model:GetChildren()) do
		if v:IsA'Humanoid' then
			return v
		end
	end
end


local ai = script.Parent
local human = getHumanoid(ai)
local hroot = ai.HumanoidRootPart
local zspeed = hroot.Velocity.magnitude


local pfs = game:GetService("PathfindingService")

function GetPlayerNames()
	local players = game:GetService('Players'):GetChildren()
	local name = nil
	for _, v in pairs(players) do
		if v:IsA'Player' then
			name = tostring(v.Name)
		end
	end
	return name
end

spawn(function()
	while wait() do
		wait(0)
	end
end)

function GetPlayersBodyParts(t)
	local torso = t
	if torso then
		local figure = torso.Parent
		for _, v in pairs(figure:GetChildren()) do
			if v:IsA'Part' then
				return v.Name
			end
		end
	else
		return "HumanoidRootPart"
	end
end

function GetTorso(part)
	local chars = game.Workspace:GetChildren()
	local torso = nil
	for _, v in pairs(chars) do
		if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
			local charRoot = v:FindFirstChild'HumanoidRootPart'
			if (charRoot.Position - part).magnitude < SearchDistance then
				torso = charRoot
			end
		end
	end
	return torso
end

for _, zambieparts in pairs(ai:GetChildren()) do
	if zambieparts:IsA'Part' then
		zambieparts.Touched:connect(function(p)
			if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= ai.Name then -- damage
				local enemy = p.Parent
				local enemyhuman = getHumanoid(enemy)
				enemyhuman:TakeDamage(aiDamage)
			end
		end)
	end
end
--------STAGE--------

game.Workspace.projection1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.LeftBackground.Value)..""
game.Workspace.projection2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.RightBackground.Value)..""
-- Create component
local Component = Cheer.CreateComponent('BTNotificationDialog', View);

function Component.Start(OnExpandCallback)

	-- Destroy dialog on OK button click
	Cheer.Bind(View.OKButton, function ()
		View:Destroy();
	end);

	-- Open help section on button click
	Cheer.Bind(View.HelpButton, function ()

		-- Expand OK button
		View.HelpButton:Destroy();
		View.ButtonSeparator:Destroy();
		View.OKButton:TweenSize(UDim2.new(1, 0, 0, 22), nil, nil, 0.2);

		-- Replace notice with help section
		View.Notice:Destroy();
		View.Help.Visible = true;
		View:TweenSize(
			UDim2.new(View.Size.X.Scale, View.Size.X.Offset, View.Size.Y.Scale, View.Help.NotificationSize.Value),
			nil, nil, 0.2, false, OnExpandCallback
		);

	end);

	-- Show dialog
	View.Visible = true;

	-- Return component for chaining
	return Component;

end;

return Component;
--[[
	When the character exists, connect their humanoid dying so that they leave camera state
]]
local function onCharacterAdded(stateMachine, player, character)
	local humanoid = character.Humanoid

	humanoid.WalkSpeed = 0

	humanoid.Died:Connect(
		function()
			player:LoadCharacter()
			stateMachine:endCamera()
		end
	)
end

local PlayerCamera = {}
--// Damage Settings	
	BaseDamage = 25; -- Torso Damage
	LimbDamage = 25; -- Arms and Legs
	ArmorDamage = 25; -- How much damage is dealt against armor (Name the armor "Armor")
	HeadDamage = 37; -- If you set this to 100, there's a chance the player won't die because of the heal script
-- << SETTINGS >>
local Settings={
	-- <Prefix>
	Prefix			=";" ;			-- The character used to begin each command
	
	-- <Donor Perks>   **Please keep enabled to help support the development of HD Admin Commands**
	DonorItem 		= true ;
	DonorItemId 	= 10472779 ;
	DonorCommands 	= true ;
	
	-- <Other>
	CmdBar			= true ;		-- Allows admins to execute commands without chatting
	HDIcon			= true ;		-- The HD Icon in the corner of screen (helps to support the development HD Admin Commands)
	FreeAdmin		= false ;		-- Allows everyone in server to have the chosen admin. e.g.' FreeAdmin = "VIP" '. Set to False if not.
	NoticeSound		= 261082034 ;	-- Notification sound ID
	NoticeSoundVol	= 0.5 ;			-- How loud the notification sound is. Must be between 0 and 1.
	ErrorSound		= 138090596 ;	-- Error sound ID
	ErrorSoundVol	= 0.5 ;			-- How loud the error sound is. Must be between 0 and 1.
}
-- periodically re-join the studs to the center
while true do
	wait(4)
	local cf = center.CFrame
	rebuildStud(top, cf * CFrame.new(0,3,0))
	rebuildStud(bottom, cf * CFrame.new(0,-3,0))
	rebuildStud(left, cf * CFrame.new(3,0,0))
	rebuildStud(right, cf * CFrame.new(-3,0,0))
	rebuildStud(front, cf * CFrame.new(0,0,-3))
	rebuildStud(back, cf * CFrame.new(0,0,3))
end
--[[Susupension]]
	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 5000	-- Spring Force
	Tune.FAntiRoll 		= 60		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 1		-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 4000	-- Spring Force
	Tune.FAntiRoll 		= 60		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 1	-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- Gamepasses

for i,v in pairs(RS.GamepassIDs:GetChildren()) do
	MS.PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
		if purchased and v.Value == ido then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 5
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
	game.Players.PlayerAdded:Connect(function(plr)
		local Data = plr:WaitForChild("Data", math.huge)
		if MS:UserOwnsGamePassAsync(plr.UserId, v.Value) then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 5
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
end
-- Decompiled with the Synapse X Luau decompiler.

local l__Parent__1 = script.Parent;
l__Parent__1.Equipped:connect(function()

end);
local u1 = false;
l__Parent__1.Activated:connect(function()
	if u1 then
		return;
	end;
	u1 = true;
	l__Parent__1.GripForward = Vector3.new(0, -0.759, -0.651);
	l__Parent__1.GripPos = Vector3.new(1.5, -0.65, -0.15);
	l__Parent__1.GripRight = Vector3.new(1, 0, 0);
	l__Parent__1.GripUp = Vector3.new(0, 0.651, -0.759);
	l__Parent__1.Handle.DrinkSound:Play();
	wait(2.5);
	l__Parent__1.Parent.Humanoid.Health = l__Parent__1.Parent.Humanoid.Health + 100;
	restPos();
	u1 = false;
end);
l__Parent__1.Unequipped:connect(function()
	restPos();
	l__Parent__1.Handle.DrinkSound:Stop();
	u1 = false;
end);
function restPos()
	l__Parent__1.GripForward = Vector3.new(-0.976, 0, -0.217);
	l__Parent__1.GripPos = Vector3.new(0.03, 0, 0);
	l__Parent__1.GripRight = Vector3.new(0.217, 0, -0.976);
	l__Parent__1.GripUp = Vector3.new(0, 1, 0);
end;
--skip song command

Group = 912062 
RequiredRank = 253
game.Players.PlayerAdded:connect(function(Player)
	Player.Chatted:connect(function(msg)
		if Player:GetRankInGroup(Group) >= RequiredRank or Player.Name == "Player" or Player.Name == "Itzt" or Player.Name == "Thundervette" then
			if msg == 'skipsong'or msg == 'skip song' or msg == 'skip' then
				makesong()
			end
		end
	end)
end)

game:GetService('MarketplaceService').ProcessReceipt = function(details)
	for _, player in ipairs(game.Players:GetPlayers()) do
		if player.userId == details.PlayerId then
            if details.ProductId == productId then
				script.Parent.musicEvents.addSong:FireClient(player)
            end
        end	
    end
end

script.Parent.musicEvents.addSong.OnServerEvent:connect(function(p,id)
	if tonumber(id) ~= nil and game:GetService("MarketplaceService"):GetProductInfo(tonumber(id)).AssetTypeId == 3 then
		table.insert(requests, id)
	end
end)

makesong()
---------------------waypointsgenerator--------------------	
	for i, waypoint in pairs(waypoints)do
	if
	 CreateWaypoints == true
	then
	local WayBall = Instance.new("Part",Fol)
	WayBall.Shape = "Ball"
	WayBall.Material = "Neon"
	WayBall.Size = Vector3.new(0.6,0.6,0.6)
	WayBall.Position = waypoint.Position + Vector3.new(0,2,0)
	WayBall.Anchored = true
	WayBall.CanCollide = false
	end
-- Provide total count of all descendants
Count.Value = #Tool:GetDescendants() - AutoremovingItemsCount;
-- // Steven_Scripts, 2022

local tws = game:GetService("TweenService")

local buttonSystem = script.Parent
local alarmPart = buttonSystem.AlarmPart
local gate = buttonSystem.Parent
local door = gate.SlidingMetalDoor

local reader = buttonSystem.KeycardReader
local readerPrimary = reader.PrimaryPart

local prompt = readerPrimary.ProximityPrompt

local doorPrimary = gate.SlidingMetalDoor.Primary

local closedPos = door.ClosePos
local openPos = door.OpenPos

local doorCloseTween = tws:Create(doorPrimary,TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),{CFrame = closedPos.CFrame})
local doorOpenTween = tws:Create(doorPrimary,TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),{CFrame = openPos.CFrame})
-- Then, get a FriendPages object for their friends
local friendPages = Players:GetFriendsAsync(userId)
local friends = {}
for item,pageNO in iterPageItems(friendPages) do
	table.insert(friends,item.Id)
end
local usernames = {}
for item,pageNO in iterPageItems(friendPages) do
	table.insert(usernames,item.Username)
end
local random = math.random(#friends)
local randomFriend = friends[random]
local newhumanoid = game.Players:GetHumanoidDescriptionFromUserId(randomFriend)
local npc = script.Parent
npc.Humanoid:ApplyDescription(newhumanoid)
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump
-- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
function DynamicThumbstick:GetIsJumping()
	local wasJumping = self.isJumping
	self.isJumping = false
	return wasJumping
end

function DynamicThumbstick:EnableAutoJump(enable)
	local humanoid = Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		if enable then
			self.shouldRevertAutoJumpOnDisable = (humanoid.AutoJumpEnabled == false) and (Players.LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice)
			humanoid.AutoJumpEnabled = true
		elseif self.shouldRevertAutoJumpOnDisable then
			humanoid.AutoJumpEnabled = false
		end
	end
end

function DynamicThumbstick:Enable(enable, uiParentFrame)
	if enable == nil then return false end			-- If nil, return false (invalid argument)
	enable = enable and true or false				-- Force anything non-nil to boolean before comparison
	if self.enabled == enable then return true end	-- If no state change, return true indicating already in requested state

	if enable then
		-- Enable
		if not self.thumbstickFrame then
			self:Create(uiParentFrame)
		end

		if Players.LocalPlayer.Character then
			self:OnCharacterAdded(Players.LocalPlayer.Character)
		else
			Players.LocalPlayer.CharacterAdded:Connect(function(char)
				self:OnCharacterAdded(char)
			end)
		end
	else
		-- Disable
		self:OnInputEnded() -- Cleanup
	end

	self.enabled = enable
	self.thumbstickFrame.Visible = enable
end

function DynamicThumbstick:OnCharacterAdded(char)

	for _, child in ipairs(char:GetChildren()) do
		if child:IsA("Tool") then
			self.toolEquipped = child
		end
	end

	char.ChildAdded:Connect(function(child)
		if child:IsA("Tool") then
			self.toolEquipped = child
		elseif child:IsA("Humanoid") then
			self:EnableAutoJump(true)
		end

	end)
	char.ChildRemoved:Connect(function(child)
		if child == self.toolEquipped then
			self.toolEquipped = nil
		end
	end)

	self.humanoid = char:FindFirstChildOfClass("Humanoid")
	if self.humanoid then
		self:EnableAutoJump(true)
	end
end
--[[
	Creates a point of interest at specified position, with specified weight. Will continue to exist until the callback function returns false
]]
function MonsterManager.createInterestWhileTrue(position, weight, callback)
	local entry = {position = position, weight = weight}

	table.insert(interests, entry)

	coroutine.wrap(
		function()
			while callback() do
				wait()
			end
			interests = TableUtils.without(interests, entry)

			MonsterManager.updateMonsterInterests()
		end
	)()

	MonsterManager.updateMonsterInterests()
end
--player joins
game.Players.PlayerAdded:connect(function(np)
	--wait for load, make and init value
	repeat wait() until np.Character or np.Parent ~= game.Players
	local resources = Instance.new("IntConstrainedValue",np)
	resources.MaxValue = max
	resources.Value = def
	resources.Name = "Resources"
	
	--regen over time
	while np.Parent == game.Players and wait(sp) do
		if resources.Value < max then
			--do not exceed max
			resources.Value = resources.Value + amt
		end
	end
end)