Pinkstack/roblox-luau-corpus-text huggingface dataset:
--!strict
--[=[
	@function removeIndices
	@within Array

	@param array {T} -- The array to remove the indices from.
	@param ... ...number -- The indices to remove the values from (can be negative).
	@return {T} -- The array with the values removed.

	Removes values from an array at the given indices.

	```lua
	local array = { 1, 2, 3 }

	local new = RemoveIndices(array, 1, 2) -- { 3 }
	local new = RemoveIndices(array, 0, -1) -- { 1 }
	```
]=]


local function removeIndices<T>(array: { T }, ...: number): { T }
	local length = #array
	local indices = {}
	local result = {}

	for _, index in ipairs({ ... }) do
		if index < 1 then
			index += length
		end

		indices[index] = true
	end

	for index, value in ipairs(array) do
		if not indices[index] then
			table.insert(result, value)
		end
	end

	return result
end

return removeIndices
--		print("Wha " .. pose)


		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		local desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end
end
-- This function produces a folder under a specified parent.
-- "soundProperties" is a table determining what the default properties of these audios will be.


function main:CreateSoundGroup(parent:Instance?, name:string?, soundProperties:{}?, isFolder:boolean?) : SoundGroup|Folder
	if not parent then warn("Parent not specified, Footstep folder parented to workspace") end
	isFolder = isFolder or false
	soundProperties = soundProperties or {}
	parent = parent or workspace
	-- Create folder
	local SoundGroup = nil
	if not isFolder then
		SoundGroup = Instance.new("SoundGroup"); SoundGroup.Volume = 1; SoundGroup.Name = name or "Footsteps"
	else
		SoundGroup = Instance.new("Folder"); SoundGroup.Name = name or "Footsteps"
	end
	local index = 0
	for soundMaterial,soundList in pairs(main.SoundIds) do
		index = 0
		local sectionGroup = nil
		if not isFolder then
			sectionGroup = Instance.new("SoundGroup"); sectionGroup.Volume = 1; sectionGroup.Name = soundMaterial
		else
			sectionGroup = Instance.new("Folder"); sectionGroup.Name = soundMaterial
		end
		for _,soundId in pairs(soundList) do
			index += 1 -- Increment index
			local soundEffect = Instance.new("Sound")
			soundEffect.Name = string.format("%s_%02i",soundMaterial:lower(),index)
			-- Set optional sound group
			if not isFolder then
				soundEffect.SoundGroup = sectionGroup
			end
			for property,value in pairs(soundProperties) do
				soundEffect[property] = value
			end
			soundEffect.SoundId = soundId
			soundEffect.Parent = sectionGroup
		end
		sectionGroup.Parent = SoundGroup
	end
	
	SoundGroup.Parent = parent
	return SoundGroup
end
-- Tycoon Module


local module = {}

module.money = script.Parent.Money
module.powers = script.Parent.Powers
module.crystals = script.Parent.Crystals

function module.init(Modules)
	local Sounds = Modules["Menu"]["sounds"]
	local Connections = {}
	local Player = game.Players.LocalPlayer
	local Tycoon = Player.PlayerTycoon.Value
	
	local function Unhook()
		for i,connection in pairs(Connections) do
			if connection.Connected then
				connection:Disconnect()
			end
			table.remove(Connections,i)
		end
	end

	local function Hook()
		Unhook()
		local Money = Player.MainData.Money
		local Powers = Player.MainData.Powers
		local Crystals = Player.MainData.Crystals
		table.insert(Connections,Powers.Changed:Connect(function()
			script.Parent.Powers.Value = Powers.Value
		end))
		table.insert(Connections,Crystals.Changed:Connect(function()
			script.Parent.Crystals.Value = Crystals.Value
		end))
		table.insert(Connections,Money.Changed:Connect(function()
			script.Parent.Money.Value = Money.Value
		end))
		script.Parent.Powers.Value = Powers.Value
		script.Parent.Crystals.Value = Crystals.Value
		script.Parent.Money.Value = Money.Value
	end
	Hook()
	Tycoon.Changed:Connect(Hook)
end

return module
--Lua primitives



t.boolean = primitive("boolean")
t.thread = primitive("thread")
t.callback = primitive("function")
t.none = primitive("nil")
t.string = primitive("string")
t.table = primitive("table")
t.userdata = primitive("userdata")

function t.number(value)
	local valueType = typeof(value)
	if valueType == "number" then
		if value == value then
			return true
		else
			return false
		end
	else
		return false
	end
end

function t.nan(value)
	if value ~= value then
		return true
	else
		return false
	end
end
-- The serialized array is compatible with pretty-format package min option.
-- However, items have default stringify depth (instead of depth - 1)
-- so expected item looks consistent by itself and enclosed in the array.


local function printReceivedArrayContainExpectedItem(received: Array<any>, index: number): string
	local receivedMap = {}
	for i, item in ipairs(received) do
		local stringified = stringify(item)
		if i == index then
			receivedMap[i] = INVERTED_COLOR(stringified)
		else
			receivedMap[i] = RECEIVED_COLOR(stringified)
		end
	end

	return RECEIVED_COLOR("{") .. table.concat(receivedMap, RECEIVED_COLOR(", ")) .. RECEIVED_COLOR("}")
end

local function printCloseTo(receivedDiff: number, expectedDiff: number, precision: number, isNot: boolean): string
	local receivedDiffString = stringify(receivedDiff)
	local expectedDiffString

	if receivedDiffString:find("e") then
		receivedDiffString = receivedDiffString:gsub("%+0", "+")
		receivedDiffString = receivedDiffString:gsub("%-0", "-")

		expectedDiffString = Number.toExponential(expectedDiff, 0)
	else
		if 0 <= precision and precision < 20 then
			local stringFormat = "%." .. precision + 1 .. "f"
			expectedDiffString = string.format(stringFormat, expectedDiff)
		else
			expectedDiffString = stringify(expectedDiff)
		end
	end

	if isNot then
		return string.format(
			"Expected precision:  %s  %s\n" .. "Expected difference: %s< %s\n" .. "Received difference: %s  %s",
			"      ",
			stringify(precision),
			"never ",
			EXPECTED_COLOR(expectedDiffString),
			"      ",
			RECEIVED_COLOR(receivedDiffString)
		)
	else
		return string.format(
			"Expected precision:  %s  %s\n" .. "Expected difference: %s< %s\n" .. "Received difference: %s  %s",
			"",
			stringify(precision),
			"",
			EXPECTED_COLOR(expectedDiffString),
			"",
			RECEIVED_COLOR(receivedDiffString)
		)
	end
end

local function printExpectedConstructorName(label: string, expected): string
	return printConstructorName(label, expected, false, true) .. "\n"
end

local function printExpectedConstructorNameNot(label: string, expected): string
	return printConstructorName(label, expected, true, true) .. "\n"
end

local function printReceivedConstructorName(label: string, received): string
	return printConstructorName(label, received, false, false) .. "\n"
end
-- Must have hopped on a segway


SegwayObject.Changed:connect(function()
	if SegwayObject.Value ~= nil and SegwayObject.Value.Parent then
		
		if UserInputService.VREnabled then
			Camera.CameraType = "Scriptable"
		else
			Camera.CameraType = "Follow"
		end
		Lights = SegwayObject.Value:WaitForChild("Lights")
		Notifiers = SegwayObject.Value:WaitForChild("Notifiers")
		Character = Player.Character
		Humanoid = Character:WaitForChild("Humanoid")
		PlayerGui = Player.PlayerGui
		SitListener = Humanoid.Seated:connect(function()Hopoff()end)
		JumpListener = UserInputService.JumpRequest:connect(function()Hopoff()end)
		ConfigLights:FireServer(0,"Cyan",true,"Neon",Lights,Notifiers)
		CheckMobile()
		CheckVR()
		IsOnSegway = true

		ContextService:BindActionAtPriority("segInputAction",onGENInput,false,2100,
			Enum.KeyCode.Space,
			Enum.KeyCode.Backspace,
			Enum.KeyCode.ButtonA,
			Enum.KeyCode.W,
			Enum.KeyCode.Up,
			Enum.KeyCode.ButtonR2,
			Enum.KeyCode.S,
			Enum.KeyCode.Down,
			Enum.KeyCode.ButtonL2,
			Enum.KeyCode.D,
			Enum.KeyCode.Right,
			Enum.KeyCode.A,
			Enum.KeyCode.Left
		)
	end
end)

SetGuiButtons()

while game:GetService("RunService").Stepped:wait() do
	
	-- Update segway's bottom direction
	CastToGround()
	
	if SegwayObject.Value and SegwayObject.Value.Parent and SeaterObject.Value and Thruster.Value and TiltMotor.Value then
	
		-- Move segway
		Accelerate()
			
		-- Update the sound
		Sound()
			
		-- Tilts the segway
		Tilt()
		UpdateVRPos()
	end
	
end
-- have a timer on the bomb X
-- make the bomb change colours X
-- have explosion instance create when timer reaches 0 X
-- if it is not == to zero then continue counting down and change colours X



explode = Instance.new("Explosion")
explode.BlastPressure = 1000000
explode.BlastRadius = 25
bombTimer = 10

function spawnBomb()
	while bombTimer >= 0 do
		if bombTimer == 0 then
			explode.Position = script.Parent.Position
			explode.Parent = game.Workspace.Bomb
			wait(0.15)
			script.Parent:Destroy()
		else
			wait(0.5)
			script.Parent.BrickColor = BrickColor.new("Really red")
			wait(0.5)
			script.Parent.BrickColor = BrickColor.new("Black")
			print("the bomb will explode in ".. bombTimer)
			bombTimer = bombTimer - 1
		end
	end
end

script.Parent.Touched:Connect(function()
	spawnBomb()
end)
-- Public Methods



function RadialMenuClass:SetRadialProps(props)
	for _, child in next, self.Frame.Radial:GetChildren() do
		for prop, value in next, props do
			child[prop] = value
		end
	end
end

function RadialMenuClass:SetDialProps(props)
	local dial = self.Frame.RadialDial
	for prop, value in next, props do
		dial[prop] = value
	end
end

function RadialMenuClass:GetTheta(userInputType)
	local delta = nil
	
	if (MOUSE_GROUP[userInputType]) then
		local frame = self.Frame
		local radius = frame.AbsoluteSize.y/2
		local center = frame.AbsolutePosition + frame.AbsoluteSize/2
		local mousePos = UIS:GetMouseLocation() + Vector2.new(0, -36)
		delta = (mousePos - center) / radius
	elseif (GAMEPAD_GROUP[userInputType]) then
		local states = UIS:GetGamepadState(userInputType)
		for _, state in next, states do
			states[state.KeyCode] = state
		end
		delta = states[Enum.KeyCode.Thumbstick2].Position * Vector3.new(1, -1, 1)
	end
	
	if (delta) then
		local m = delta.Magnitude
		if (m >= self.DeadZoneIn and m <= self.DeadZoneOut) then
			return math.atan2(delta.y, -delta.x)
		end
	end
end

function RadialMenuClass:PickIndex(theta)
	local frameRot = math.rad(self.Frame.Rotation)
	local toDeg = math.deg(theta - self.Rotation + frameRot + EX_OFFSET + 2*TAU) % 360
	local closest = math.floor(toDeg / (360 / self.SubN))
	return closest + 1
end

function RadialMenuClass:GetRotation(index)
	return -TAU * ((index - 1) / self.SubN)
end

function RadialMenuClass:GetRadial(index)
	return self.Frame.Radial[index]
end

function RadialMenuClass:GetAttachment(index)
	return self.Frame.Attach[index]
end

function RadialMenuClass:GetAnimation(id)
	return game.ReplicatedStorage.Events.GetEmote:InvokeServer(id)
end


function RadialMenuClass:IsVisible()
	local frame = self.Frame
	while (frame and frame:IsA("GuiObject") and frame.Visible) do
		frame = frame.Parent
		if (frame and frame:IsA("ScreenGui") and frame.Enabled) then
			return true
		end
	end
	return false
end

function RadialMenuClass:Destroy()
	self._Maid:Sweep()
	self.Frame:Destroy()
	self.Clicked = nil
	self.Hover = nil
	self.Frame = nil
end
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "earth"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0,-0.25,0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- Bind function to update event. Used to update player's orientation if FilteringEnabled
-- is true (otherwise the rotation would not replicate from the rotating player)


updateEvent.OnServerEvent:connect(function(player, neckC0, rshoulderC0)
	local character = player.Character
	character.Torso.Neck.C0 = neckC0
	character.Torso:FindFirstChild("Right Shoulder").C0 = rshoulderC0
end)
--Client -> Server


	-- Player
	local RF_getPlayerData = remoteFunctions.Client.GetPlayerData
	-- Player Vehicle
	local RF_vehicleSpawnRequest = remoteFunctions.Client.Vehicle.VehicleSpawnRequest
	local RF_vehicleRemoveRequest = remoteFunctions.Client.Vehicle.VehicleRemoveRequest
	-- Weapon
	local RF_GetUnlockedWeapons = remoteFunctions.Client.Weapon.GetUnlockedWeapons
	local RF_GetEquipedWeapon = remoteFunctions.Client.Weapon.GetEquipedWeapon
	local RF_GetWeaponInfo = remoteFunctions.Client.Weapon.GetWeaponInfo
	local RF_EquipWeapon = remoteFunctions.Client.Weapon.EquipWeapon
	local RF_UnEquipWeapon = remoteFunctions.Client.Weapon.UnEquipWeapon
	local RF_BuyWeapon = remoteFunctions.Client.Weapon.BuyWeapon
	-- Twitter
	local RF_redeemCode = remoteFunctions.Client.Twitter.RedeemCode
-----------------------------------------------





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 = 10000000
		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)
--[[
	Called when the goal state changes value; this will initiate a new tween.
	Returns false as the current value doesn't change right away.
]]


function class:update()
	self._prevValue = self._currentValue
	self._nextValue = self._goalState:get(false)

	self._currentTweenStartTime = os.clock()
	self._currentTweenInfo = self._tweenInfo

	local tweenDuration = self._tweenInfo.DelayTime + self._tweenInfo.Time
	if self._tweenInfo.Reverses then
		tweenDuration += self._tweenInfo.Time
	end
	tweenDuration *= self._tweenInfo.RepeatCount
	self._currentTweenDuration = tweenDuration

	-- start animating this tween
	TweenScheduler.add(self)
	return false
end

if ENABLE_PARAM_SETTERS then

	--[[
		Specifies a new TweenInfo to use when the goal state changes in the future.
	]]
	function class:setTweenInfo(newTweenInfo: TweenInfo)
		self._tweenInfo = newTweenInfo
	end

end

local function Tween(goalState: Types.State<Types.Animatable>, tweenInfo: TweenInfo?)
	local currentValue = goalState:get(false)

	local self = setmetatable({
		type = "State",
		kind = "Tween",
		dependencySet = {[goalState] = true},
		-- if we held strong references to the dependents, then they wouldn't be
		-- able to get garbage collected when they fall out of scope
		dependentSet = setmetatable({}, WEAK_KEYS_METATABLE),
		_goalState = goalState,
		_tweenInfo = tweenInfo or TweenInfo.new(),

		_prevValue = currentValue,
		_nextValue = currentValue,
		_currentValue = currentValue,

		-- store current tween into separately from 'real' tween into, so it
		-- isn't affected by :setTweenInfo() until next change
		_currentTweenInfo = tweenInfo,
		_currentTweenDuration = 0,
		_currentTweenStartTime = 0
	}, CLASS_METATABLE)

	initDependency(self)
	-- add this object to the goal state's dependent set
	goalState.dependentSet[self] = true

	return self
end

return Tween
--[[
Creates a part.
--]]


local function CreatePart(Color,Size,CF,Parent)
	local Part = Instance.new("Part")
	Part.Color = Color
	Part.Material = "Plastic"
	Part.Size = Size
	Part.CFrame = CF
	Part.TopSurface = "Studs"
	Part.BottomSurface = "Inlet"
	Part.Parent = Parent
	
	return Part
end
--Stickmasterluke




sp=script.Parent


local h=sp:FindFirstChild("Humanoid")
local t=sp:FindFirstChild("Torso")
if h~=nil and t~=nil and h.Health>0 then
	local f=Instance.new("Fire")
	f.Color=Color3.new(1,0,0)
	f.SecondaryColor=Color3.new(1,1,1)
	f.Size=3
	f.Heat=2
	f.Parent=t
	if f~=nil then
		f:remove()
	end
end
script:remove()
-- emote bindable hook


if FFlagAnimateScriptEmoteHook then
	script:WaitForChild("PlayEmote").OnInvoke = function(emote)
		-- Only play emotes when idling
		if pose ~= "Standing" then
			return
		end

		if emoteNames[emote] ~= nil then
			-- Default emotes
			playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)

			return true
		elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
			-- Non-default emotes
			playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)
			return true
		end

		-- Return false to indicate that the emote could not be played
		return false
	end
end
--!strict
-- upstream: https://github.com/facebook/react/blob/56e9feead0f91075ba0a4f725c9e4e343bca1c67/packages/react/src/index.js
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 *]]
-- << MORPHS >>


function module:CreateMorphs()
	main:GetModule("cf"):ClearPage(pages.morphs)
	
	--Organise morphs
	local morphsList = {}
	local searchText = frame.SearchBar.Frame.TextBox.Text
	for morphName,_ in pairs(main.morphNames) do
		local cName = string.lower(morphName)
		if string.match(cName, searchText) then
			table.insert(morphsList, morphName)
		end
	end
	table.sort(morphsList)
	table.insert(morphsList, 1, main.pdata.Prefix.. "morph <player> <morphName>")
				
	--Create morph labels
	for i,morphName in pairs(morphsList) do
		local label = templateM:Clone()
		if i == 1 then
			label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
			label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
		else
			label.BackgroundColor3 = main:GetModule("cf"):GetLabelBackgroundColor(i)
			label.TextLabel.TextColor3 = Color3.fromRGB(235, 235, 235)
		end
		label.TextLabel.Text = morphName
		label.Name = morphName
		label.Visible = true
		label.Parent = pages.morphs
	end
	
	--Canvas size
	pages.morphs.CanvasSize = UDim2.new(0,0,0,#morphsList*templateM.AbsoluteSize.Y)
end
--[[**
	Returns a t.union of each key in the table as a t.literal

	@param keyTable The table to get keys from

	@returns True iff the condition is satisfied, false otherwise
**--]]


function t.keyOf(keyTable)
	local keys = {}
	for key in pairs(keyTable) do
		keys[#keys + 1] = key
	end
	return t.literal(unpack(keys))
end
--[[
	Fires when the local player begins input. Ignores all input except if
	the user presses `KEY`. If `KEY` is pressed opens the game GUI unless
	player already interacting with the game

	Arguments: 
		actionName - Name of the ContextActionService action
		userInputState - State of input
		inputObject - Contains info about input
	Returns: None
]]

--
local function toggleKeyboard(actionName, userInputState, inputObject)
	if not (userInputState == Enum.UserInputState.Begin) then return end
	toggleInteraction()
end
local function toggleMouse(playerWhoClicked)
	if playerWhoClicked then
		toggleInteraction()
	end
end
-- Variables (best not to touch these!)


local button = script.Parent 
local car = script.Parent.Parent.Car.Value
local sound = script.Parent.Start
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
	if script.Parent.Text == "Engine: Off" then -- If the text says it's off then..
		sound:Play() -- Startup sound plays..
		wait(0.4) -- For realism. Okay?
		script.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
		button.Text = "Engine: On"  -- You don't really need this, but I would keep it.
	else -- If it's on then when you click the button,
		script.Parent.Parent.IsOn.Value = false -- The car is turned off.
		button.Text = "Engine: Off"
	end -- Don't touch this.
end) -- And don't touch this either.
--Stickmasterluke




sp=script.Parent


taseduration=7
rate=.5


local s=Instance.new("Sound")
s.SoundId="http://www.roblox.com/asset/?id=82277505"
s.Looped=true

joints={}
local t=sp:FindFirstChild("HumanoidRootPart")
if t~=nil then
	s.Parent=t
	s:Play()
	for i,v in ipairs(t:GetChildren()) do
		if v.className=="Motor" or v.className=="Motor6D" or v.className=="Weld" or v.className=="ManualWeld" then
			table.insert(joints,v)
		end
	end
end

if #joints>=1 then
	local trippy = script.Trippy:Clone()
	trippy.Parent = sp:FindFirstChild'Humanoid'
	trippy.Disabled = false
	for i=1,taseduration/rate do
		for i,v in ipairs(joints) do
			if v~=nil then
				v.CurrentAngle=(math.random()-.5)*5
			end
		end
		local h=sp:FindFirstChild("Humanoid")
		local t=sp:FindFirstChild("HumanoidRootPart")
		if t~=nil and h~=nil then
			--t.RotVelocity = Vector3.new(math.random()-.5,math.random()-.5,math.random()-.5)*2*360
			wait(rate)
		end
	end
	trippy:Destroy()
end
s:Stop()
script:remove()
--[[
	Stringifies a number and places a separator between thousands.


	```lua
	separateThousands(1000000) -- 1,000,000
	separateThousands(12345678, ".") -- 12.345.678
	```

	This function is called when setting the text for the PrimaryButton
	component when in Purchase mode; the text reflects the price in Robux.

	@within Modules
]]



local function separateThousands(n: number, sep: string?): string
	sep = sep or ","

	local str = tostring(n)

	-- Reverse to apply commas from right-to-left of the original number.
	str = str:reverse():gsub("%d%d%d", "%1,")

	-- Reverse back to normal and trim off any leading commas. The trim is
	-- needed when the number of digits is divisible by 3.
	str = str:reverse():gsub("^,", "")

	return str
end

return separateThousands