Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Create component


local NotificationDialog = Roact.PureComponent:extend(script.Name)

function NotificationDialog:init()
    self:setState({
        ShouldDisplayDetails = false;
    })
end

function NotificationDialog:render()
    return new('Frame', {
        BackgroundColor3 = Color3.fromRGB(0, 0, 0);
        BackgroundTransparency = 0.7;
        BorderSizePixel = 0;
        Size = UDim2.new(1, 0, 0, 22 + 2);
        LayoutOrder = self.props.LayoutOrder;
    }, {
        ColorBar = new('Frame', {
            BorderSizePixel = 0;
            BackgroundColor3 = self.props.ThemeColor;
            Size = UDim2.new(1, 0, 0, 2);
        });
        OKButton = new('TextButton', {
            BackgroundColor3 = Color3.fromRGB(0, 0, 0);
            BackgroundTransparency = 0.8;
            BorderSizePixel = 0;
            AnchorPoint = Vector2.new(0, 1);
            Position = UDim2.new(0, 0, 1, 0);
            Size = UDim2.new(self.state.ShouldDisplayDetails and 1 or 0.5, 0, 0, 22);
            Text = 'GOT IT';
            Font = Enum.Font.Gotham;
            TextSize = 10;
            TextColor3 = Color3.fromRGB(255, 255, 255);
            [Roact.Event.Activated] = function (rbx)
                self.props.OnDismiss()
            end;
        });
        DetailsButton = (not self.state.ShouldDisplayDetails or nil) and new('TextButton', {
            BackgroundColor3 = Color3.fromRGB(0, 0, 0);
            BackgroundTransparency = 0.8;
            BorderSizePixel = 0;
            AnchorPoint = Vector2.new(0, 1);
            Position = UDim2.new(0.5, 0, 1, 0);
            Size = UDim2.new(0.5, 0, 0, 22);
            Text = 'WHAT CAN I DO?';
            Font = Enum.Font.Gotham;
            TextSize = 10;
            TextColor3 = Color3.fromRGB(255, 255, 255);
            [Roact.Event.Activated] = function (rbx)
                self:setState({
                    ShouldDisplayDetails = true;
                })
            end;
        });
        ButtonDivider = (not self.state.ShouldDisplayDetails or nil) and new('Frame', {
            BackgroundColor3 = Color3.fromRGB(0, 0, 0);
            BackgroundTransparency = 0.75;
            BorderSizePixel = 0;
            Position = UDim2.new(0.5, 0, 1, 0);
            AnchorPoint = Vector2.new(0.5, 1);
            Size = UDim2.new(0, 1, 0, 22);
        });
        Text = new('TextLabel', {
            BackgroundTransparency = 1;
            Position = UDim2.new(0, 0, 0, 2);
            Size = UDim2.new(1, 0, 1, -22 - 2);
            TextWrapped = true;
            RichText = true;
            Font = Enum.Font.GothamSemibold;
            TextColor3 = Color3.fromRGB(255, 255, 255);
            TextSize = 11;
            TextStrokeTransparency = 0.9;
            LineHeight = 1;
            Text = (not self.state.ShouldDisplayDetails) and
                self.props.NoticeText or
                self.props.DetailText;
            [Roact.Change.TextBounds] = function (rbx)
                rbx.Parent.Size = UDim2.new(1, 0, 0, rbx.TextBounds.Y + 29 + 22 + 2)
            end;
        });
    })
end

return NotificationDialog
--------------------------------------------


local Body = script.Parent.Parent

local Head = Body:WaitForChild("Head")
local Hum = Body:WaitForChild("Humanoid")
local Core = Body:WaitForChild("HumanoidRootPart")
local IsR6 = (Hum.RigType.Value==0)
local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso")
local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck")	
local Waist = (not IsR6 and Trso:WaitForChild("Waist"))

local NeckOrgnC0 = Neck.C0
local WaistOrgnC0 = (not IsR6 and Waist.C0)

local LookingAtValue = Instance.new("ObjectValue"); LookingAtValue.Parent = Body; LookingAtValue.Name = "LookingAt"
--[[
	
	This is the main script for the gun
	
	The only thing you should change is the settings
	
	Don't change anything else or you might risk breaking the gun
	
	If you have any questions / comments / concerns / sandwiches, message me
	
	Enjoy!
	     ______   ______           __          ______           _                ______
	    / _/ _/  /_  __/_  _______/ /_  ____  / ____/_  _______(_)___  ____     /  /  /
	   / // /     / / / / / / ___/ __ \/ __ \/ /_  / / / / ___/ / __ \/ __ \    / // / 
	  / // /     / / / /_/ / /  / /_/ / /_/ / __/ / /_/ (__  ) / /_/ / / / /   / // /  
	 / // /     /_/  \__,_/_/  /_.___/\____/_/    \__,_/____/_/\____/_/ /_/  _/ // /   
	/__/__/                                                                 /__/__/    

--]]



repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
wait(1 / 20)
-- << Functions >> --



UserInputService.MouseIconEnabled = false

function lerp(a, b, c)
	return a + (b - a) * c
end

bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
	if script.Parent.Humanoid.MoveDirection.Magnitude > 0 then
		deltaTime = deltaTime * (script.Parent.Humanoid.WalkSpeed * 3.75)	
	else
		deltaTime = deltaTime * 60
	end
	print(deltaTime)
	if Humanoid.Health <= 0 then
		bobbing:Disconnect()
		return
	end
	local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
	local calcRootMagnitude = math.min(rootMagnitude, 50)
	if deltaTime > 3 then
		func1 = 0
		func2 = 0
	else
		func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
		func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
	end
	Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
	val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
	func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
	func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
	if rootMagnitude > 1 then
		val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
	else
		val = lerp(val, 0, 0.05 * deltaTime)
	end
	if rootMagnitude > 12 then
		int = 20
		int2 = 18
	elseif rootMagnitude > 0.1 then
		int = 12
		int2 = 14
	else
		int2 = 0
	end
	vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
--------RIGHT DOOR --------


game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(1013)

game.Workspace.doorright.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(1013)

game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(1013)

game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- Define the jump duration


local jumpDuration = 0.1

btn.MouseButton1Click:Connect(function()
			-- Create the jump tween
			local Click = script.Click
			local jumpTweenInfo = TweenInfo.new(jumpDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local jumpTween = game:GetService("TweenService"):Create(btn, jumpTweenInfo, {
		Size = UDim2.new(btn.Size.X.Scale * jumpScale, btn.Size.X.Offset,
			btn.Size.Y.Scale * jumpScale, btn.Size.Y.Offset),
		Position = UDim2.new(btn.Position.X.Scale - ((jumpScale - 1) / 2),
			btn.Position.X.Offset, btn.Position.Y.Scale - ((jumpScale - 1) / 2),
			btn.Position.Y.Offset)
			})

			-- Play the jump tween
			jumpTween:Play()
			Click:Play()

			-- Reset the button's size and position after the jump is complete
			jumpTween.Completed:Connect(function()
		btn.Size = UDim2.new(btn.Size.X.Scale / jumpScale, btn.Size.X.Offset,
			btn.Size.Y.Scale / jumpScale, btn.Size.Y.Offset)
		btn.Position = UDim2.new(btn.Position.X.Scale + ((jumpScale - 1) / 2),
			btn.Position.X.Offset, btn.Position.Y.Scale + ((jumpScale - 1) / 2),
			btn.Position.Y.Offset)
			end)
end)
-- public static functions



function region3.new(cf, size)
	local self = {};
	self.CFrame = cf;
	self.Size = size;
	self.input = {vertices.block(cf, size * 0.5, {})};
	self.support = support.pointCloud;
	self.centroid = cf.p;
	return setmetatable(self, region3_mt);
end;

region3.block = region3.new;

function region3.wedge(cf, size)
	local self = {};
	self.CFrame = cf;
	self.Size = size;
	self.input = {vertices.wedge(cf, size * 0.5, {})};
	self.support = support.pointCloud;
	self.centroid = centroid(self.input[1]);
	return setmetatable(self, region3_mt);
end;

function region3.cornerWedge(cf, size)
	local self = {};
	self.CFrame = cf;
	self.Size = size;
	self.input = {vertices.cornerWedge(cf, size * 0.5, {})};
	self.support = support.pointCloud;
	self.centroid = centroid(self.input[1]);
	return setmetatable(self, region3_mt);
end;

function region3.cylinder(cf, size)
	local self = {};
	self.CFrame = cf;
	self.Size = size;
	self.input = {cf, size * 0.5};
	self.support = support.cylinder;
	self.centroid = cf.p;
	return setmetatable(self, region3_mt);
end;

function region3.ellipsoid(cf, size)
	local self = {};
	self.CFrame = cf;
	self.Size = size;
	self.input = {cf, size * 0.5};
	self.support = support.ellipsoid;
	self.centroid = cf.p;
	return setmetatable(self, region3_mt);
end;

function region3.pointCloud(cloud)
	local self = {};
	self.CFrame = CFrame.new(centroid(cloud));
	self.Size = v3();
	self.input = cloud;
	self.support = support.pointCloud;
	self.centroid = self.CFrame.p;
	return setmetatable(self, region3_mt);
end;

function region3.fromPart(part)
	return classify(part);
end;
-- ROBLOX: use patched console from shared


local console = require(script.Parent.console)

local loggedTypeFailures = {}

local ReactComponentStackFrame = require(script.Parent.ReactComponentStackFrame)
local describeUnknownElementTypeFrameInDEV =
	ReactComponentStackFrame.describeUnknownElementTypeFrameInDEV

local ReactSharedInternals = require(script.Parent.ReactSharedInternals)

local describeError = require(script.Parent["ErrorHandling.roblox"]).describeError

local ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame
--// F key, Horn


mouse.KeyDown:connect(function(key)
	if key=="h" then 
		veh.ELS.Sirens.MAN.Transparency = 0
		veh.ELS.Siren.Man:Play()
		veh.ELS.Siren2.Man:Play()
		veh.ELS.Sirens.Horn.Transparency = 0
		veh.ELS.Siren.Wail.Volume = 0
		veh.ELS.Siren.Yelp.Volume = 0
		veh.ELS.Siren.Priority.Volume = 0	
		veh.ELS.Siren2.Wail.Volume = 0
		veh.ELS.Siren2.Yelp.Volume = 0
		veh.ELS.Siren2.Priority.Volume = 0
	end
end)
-- Menus


local menuContainer = Instance.new("Frame")
menuContainer.Name = "MenuContainer"
menuContainer.BackgroundTransparency = 1
menuContainer.BorderSizePixel = 0
menuContainer.AnchorPoint = Vector2.new(1, 0)
menuContainer.Size = UDim2.new(0, 500, 0, 50)
menuContainer.ZIndex = -2
menuContainer.ClipsDescendants = true
menuContainer.Visible = true
menuContainer.Parent = iconContainer
menuContainer.Active = false
menuContainer.Selectable = false

local menuFrame = Instance.new("ScrollingFrame")
menuFrame.Name = "MenuFrame"
menuFrame.BackgroundTransparency = 1
menuFrame.BorderSizePixel = 0
menuFrame.AnchorPoint = Vector2.new(0, 0)
menuFrame.Position = UDim2.new(0, 0, 0, 0)
menuFrame.Size = UDim2.new(1, 0, 1, 0)
menuFrame.ZIndex = -1 + 10
menuFrame.ClipsDescendants = false
menuFrame.Visible = true
menuFrame.TopImage = ""--menuFrame.MidImage
menuFrame.BottomImage = ""--menuFrame.MidImage
menuFrame.HorizontalScrollBarInset = Enum.ScrollBarInset.Always
menuFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
menuFrame.Parent = menuContainer
menuFrame.Active = false
menuFrame.Selectable = false
menuFrame.ScrollingEnabled = false

local menuList = Instance.new("UIListLayout")
menuList.Name = "MenuList"
menuList.FillDirection = Enum.FillDirection.Horizontal
menuList.HorizontalAlignment = Enum.HorizontalAlignment.Right
menuList.SortOrder = Enum.SortOrder.LayoutOrder
menuList.Parent = menuFrame

local menuInvisBlocker = Instance.new("Frame")
menuInvisBlocker.Name = "MenuInvisBlocker"
menuInvisBlocker.BackgroundTransparency = 1
menuInvisBlocker.Size = UDim2.new(0, -2, 1, 0)
menuInvisBlocker.Visible = true
menuInvisBlocker.LayoutOrder = 999999999
menuInvisBlocker.Parent = menuFrame
menuInvisBlocker.Active = false
-- Left Arms


local LUA = character.UpperTorso:FindFirstChild("LeftShoulderRigAttachment")
local LUARig = character.LeftUpperArm:FindFirstChild("LeftShoulderRigAttachment")
local LLA = character.LeftUpperArm:FindFirstChild("LeftElbowRigAttachment")
local LLARig = character.LeftLowerArm:FindFirstChild("LeftElbowRigAttachment")
local LH = character.LeftLowerArm:FindFirstChild("LeftWristRigAttachment")
local LHRig = character.LeftHand:FindFirstChild("LeftWristRigAttachment")
------------------------------------------------



local function EnterFreecam()
	ToggleGui(false)
	UIS.MouseIconEnabled = false
	Maid:Mark(UIS.InputBegan:Connect(function(input, processed)
		if input.UserInputType == Enum.UserInputType.MouseButton2 then
			UIS.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
			local conn = UIS.InputChanged:Connect(Panned)
			repeat
				input = UIS.InputEnded:wait()
			until input.UserInputType == Enum.UserInputType.MouseButton2 or not freeCamEnabled
			panDeltaMouse = Vector2.new()
			panDeltaGamepad = Vector2.new()
			conn:Disconnect()
			if freeCamEnabled then
				UIS.MouseBehavior = Enum.MouseBehavior.Default
			end
		elseif input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
			SpeedModifier = 0.5
		end
	end))

	Maid:Mark(UIS.InputEnded:Connect(function(input, processed)
		if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
			SpeedModifier = 1
		end
	end))

	camera.CameraType = Enum.CameraType.Scriptable

	local hum, hrp = GetChar()
	if hrp then
		hrp.Anchored = true
	end
	if hum then
		hum.WalkSpeed = 0
		Maid:Mark(hum.Jumping:Connect(function(active)
			if active then
				hum.Jumping = false
			end
		end))
	end

	velSpring.t, velSpring.v, velSpring.x = Vector3.new(), Vector3.new(), Vector3.new()
	rotSpring.t, rotSpring.v, rotSpring.x = Vector2.new(), Vector2.new(), Vector2.new()
	fovSpring.t, fovSpring.v, fovSpring.x = camera.FieldOfView, 0, camera.FieldOfView

	local camCFrame = camera.CFrame
	local lookVector = camCFrame.lookVector.unit

	stateRot = Vector2.new(
		math.asin(lookVector.y),
		math.atan2(-lookVector.z, lookVector.x) - math.pi/2
	)
	panDeltaMouse = Vector2.new()

	local playerGui = player:WaitForChild("PlayerGui")
	for _, obj in next, playerGui:GetChildren() do
		if obj:IsA("ScreenGui") and obj.Enabled then
			obj.Enabled = false
			screenGuis[obj] = true
		end
	end
	if letterBoxEnabled then
		letterbox.Enabled = true
	end
	RS:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, UpdateFreecam)
	freeCamEnabled = true
end

local function ExitFreecam()
	freeCamEnabled = false
	if letterBoxEnabled then
		letterbox.Enabled = false
	end
	UIS.MouseIconEnabled = true
	UIS.MouseBehavior = Enum.MouseBehavior.Default
	Maid:Sweep()
	RS:UnbindFromRenderStep("Freecam")
	local hum, hrp = GetChar()
	if hum then
		hum.WalkSpeed = 16
	end
	if hrp then
		hrp.Anchored = false
	end
	camera.FieldOfView = DEF_FOV
	camera.CameraType = Enum.CameraType.Custom
	for obj in next, screenGuis do
		obj.Enabled = true
	end
	screenGuis = {}
	ToggleGui(true)
end
--[[
	Calculate success, failure, and skipped test counts in the tree at the
	current point in the execution.
]]


function TestSession:calculateTotals()
	local results = self.results

	results.successCount = 0
	results.failureCount = 0
	results.skippedCount = 0

	results:visitAllNodes(function(node)
		local status = node.status
		local nodeType = node.planNode.type

		if nodeType == TestEnum.NodeType.It then
			if status == TestEnum.TestStatus.Success then
				results.successCount = results.successCount + 1
			elseif status == TestEnum.TestStatus.Failure then
				results.failureCount = results.failureCount + 1
			elseif status == TestEnum.TestStatus.Skipped then
				results.skippedCount = results.skippedCount + 1
			end
		end
	end)
end
-- Decides when the GUI should be hidden.
-- 
-- ForbiddenJ



UserInputService = game:GetService("UserInputService")

IsDisplayed = script.Parent.IsDisplayed
IsHiddenByOtherGUI = script.Parent.IsHiddenByOtherGUI
HideGuiEnabled = game.ReplicatedStorage.ClientConfig.HideGuiEnabled
IsGameMenuOpen = script.Parent.Parent.GameMenu.IsOpen

MouseHovering = false

function Update()
	IsDisplayed.Value =
		(not HideGuiEnabled.Value or MouseHovering or UserInputService.TouchEnabled) and not IsHiddenByOtherGUI.Value
end

HideGuiEnabled.Changed:Connect(Update)
IsHiddenByOtherGUI.Changed:Connect(Update)
IsGameMenuOpen.Changed:Connect(function(value)
	IsHiddenByOtherGUI.Value = value
end)
UserInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(Update)
script.Parent.MouseEnter:Connect(function()
	MouseHovering = true
	Update()
end)
script.Parent.MouseLeave:Connect(function()
	MouseHovering = false
	Update()
end)

IsHiddenByOtherGUI.Value = IsGameMenuOpen.Value
Update()
--[=[
	@class RemoteProperty
	@server
	Created via `ServerComm:CreateProperty()`.

	Values set can be anything that can pass through a
	[RemoteEvent](https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events#parameter-limitations).

	:::caution Network
	Calling any of the data setter methods (e.g. `Set()`) will
	fire the underlying RemoteEvent to replicate data to the
	clients. Therefore, setting data should only occur when it
	is necessary to change the data that the clients receive.
	:::

	:::caution Tables
	Tables _can_ be used with RemoteProperties. However, the
	RemoteProperty object will _not_ watch for changes within
	the table. Therefore, anytime changes are made to the table,
	the data must be set again using one of the setter methods.
	:::
]=]


local RemoteProperty = {}
RemoteProperty.__index = RemoteProperty

function RemoteProperty.new(parent: Instance, name: string, initialValue: any, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?)
	local self = setmetatable({}, RemoteProperty)
	self._rs = RemoteSignal.new(parent, name, inboundMiddleware, outboundMiddleware)
	self._value = initialValue
	self._perPlayer = {}
	self._playerRemoving = Players.PlayerRemoving:Connect(function(player)
		self._perPlayer[player] = nil
	end)
	self._rs:Connect(function(player)
		local playerValue = self._perPlayer[player]
		local value = if playerValue == nil then self._value elseif playerValue == None then nil else playerValue
		self._rs:Fire(player, value)
	end)
	return self
end
-- FIXME Luau: GetPlayers() is typed as returning an array of Instances so we
-- need to cast it to `{ Player }`


local players = (Players:GetPlayers() :: any) :: { Player }
local controller = ExperienceComponents.HumanoidControllers.new(players, {
	Players.LocalPlayer :: Player,
})

Players.PlayerAdded:Connect(function(player)
	controller:addHumanoidController(player)
end)

Players.PlayerRemoving:Connect(function(player)
	controller:removeHumanoidController(player)
end)

local hideOthers: types.Action = {
	name = "Hide Others",
	description = "Toggle visibility of other players in your photo",
	icon = assets.UsersOutline,
	activeIcon = assets.UsersSolid,
	onActivated = function()
		controller:hideHumanoids()

		return function()
			controller:showHumanoids()
		end
	end,
}

return hideOthers
-- same as jump for now



function moveFreeFall()
	RightShoulder.MaxVelocity = 0.1
	LeftShoulder.MaxVelocity = 0.1
	RightShoulder:SetDesiredAngle(0)
	LeftShoulder:SetDesiredAngle(0)
	RightHip:SetDesiredAngle(0)
	LeftHip:SetDesiredAngle(0)
end

function moveSit()
	RightShoulder.MaxVelocity = 0.1
	LeftShoulder.MaxVelocity = 0.1
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()
	
	if (toolAnim == "None") then
		RightShoulder:SetDesiredAngle(1.57)
		return
	end

	if (toolAnim == "Slash") then
		RightShoulder.MaxVelocity = 0.5
		RightShoulder:SetDesiredAngle(0)
		return
	end

	if (toolAnim == "Lunge") then
		RightShoulder.MaxVelocity = 0.5
		LeftShoulder.MaxVelocity = 0.5
		RightShoulder:SetDesiredAngle(1.57)
		LeftShoulder:SetDesiredAngle(1.0)
		RightHip:SetDesiredAngle(1.57)
		LeftHip:SetDesiredAngle(1.0)
		return
	end
end

function move(time)
	local amplitude
	local frequency
  
	if (pose == "Jumping") then
		moveJump()
		return
	end

	if (pose == "FreeFall") then
		moveFreeFall()
		return
	end
 
	if (pose == "Seated") then
		moveSit()
		return
	end

	local climbFudge = 0
	
	if (pose == "Running") then
		RightShoulder.MaxVelocity = 0.1
		LeftShoulder.MaxVelocity = 0.1
		amplitude = 0.66
		frequency = 9
	elseif (pose == "Climbing") then
		RightShoulder.MaxVelocity = 0.1
		LeftShoulder.MaxVelocity = 0.1
		amplitude = 0.66
		frequency = 9
	else
		amplitude = 0.1
		frequency = 1
	end

	desiredAngle = amplitude * math.sin(time*frequency)

	RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
	LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
	RightHip:SetDesiredAngle(-desiredAngle)
	LeftHip:SetDesiredAngle(-desiredAngle)


	local tool = getTool()

	if tool then
	
		animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()

		
	else
		toolAnim = "None"
		toolAnimTime = 0
	end
end
-- Methods



function Sound.Get(Name : string) : Sound
	local s = Map[Name:lower()]
	if not s then warn(("No sound named '%s' found."):format(Name)) return EmptySound:Clone() end
	return s:Clone()
end

function Sound.GetGroup(Name : string) : {Sound}
	return Groups[Name:lower()]
end

function Sound.GetRandomFromGroup(Name : string, Rng : Random) : Sound
	Rng = Rng or System.Random
	local Group = Sound.GetGroup(Name)
	
	if not Group then warn(("No group named '%s' found."):format(Name)) return EmptySound:Clone() end
	return Group[Rng:NextInteger(1, #Group)]:Clone()
end
-- script makes the fall script active for ALL players! dont mess with this if your unexperienced.



function onPlayerRespawned(newPlayer)
	while true do
		if newPlayer.Character ~= nil then break end
		wait(.1)
	end
	local newJob = script.Fall:Clone()
	newJob.Disabled = false
	newJob.Parent = newPlayer.Character
end

function onPlayerEntered(newPlayer)
	newPlayer.Changed:connect(function (property)
		if (property == "Character") then
			onPlayerRespawned(newPlayer)
		end
	end)
end
c = game.Players:getChildren()
for i = 1, #c do
onPlayerEntered(c[i])
end
game.Players.PlayerAdded:connect(onPlayerEntered)