Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- [Head, Torso, HumanoidRootPart], "Torso" and "UpperTorso" works with both R6 and R15.
-- Also make sure to not misspell it.


local PartToLookAt = "Head" -- What should the npc look at. If player doesn't has the specific part it'll looks for RootPart instead.

local LookBackOnNil = true -- Should the npc look at back straight when player is out of range.

local SearchLoc = {workspace} -- Will get player from these locations
--[=[
	Set a handler that will be called regardless of the promise's fate. The handler is called when the promise is resolved, rejected, *or* cancelled.

	Returns a new promise chained from this promise.

	:::caution
	If the Promise is cancelled, any Promises chained off of it with `andThen` won't run. Only Promises chained with `finally` or `done` will run in the case of cancellation.
	:::

	```lua
	local thing = createSomething()

	doSomethingWith(thing)
		:andThen(function()
			print("It worked!")
			-- do something..
		end)
		:catch(function()
			warn("Oh no it failed!")
		end)
		:finally(function()
			-- either way, destroy thing

			thing:Destroy()
		end)

	```

	@param finallyHandler (status: Status) -> ...any
	@return Promise<...any>
]=]


function Promise.prototype:finally(finallyHandler)
	assert(finallyHandler == nil or isCallable(finallyHandler), string.format(ERROR_NON_FUNCTION, "Promise:finally"))
	return self:_finally(debug.traceback(nil, 2), finallyHandler)
end
--[=[
	This function returns a table with the keys of the passed dictionary.
	
	```lua
	local Dictionary = {
		A = 1,
		B = 2,
		C = 3,
	}
	
	print(TableKit.Keys(Dictionary)) -- prints {"A", "B", "C"}
	```

	@within TableKit
	@param dictionary table
	@return table
]=]


function TableKit.Keys(dictionary: { [unknown]: unknown }): { unknown }
	local keyArray = {}

	for key in dictionary do
		table.insert(keyArray, key)
	end

	return keyArray
end
--| Main |--


Tool.Activated:Connect(function()
	if State.Value == "None" then
		State.Value = "PhongDev"
		
			--| Fov |--
			spawn(function()
				local Properties = {FieldOfView = DFOV - 20}
				local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
				local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
				Tween:Play()
				
				wait(2.1)
				
				local Properties = {FieldOfView = DFOV + 30}
				local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
				local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
				Tween:Play()
				
				task.wait(0.8)
				
				local Properties = {FieldOfView = DFOV}
				local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
				local Tween = TS:Create(game.Workspace.CurrentCamera,Info,Properties)
				Tween:Play()
			end)
			--| Cam Shake |--
			delay(1, function()
				local CameraShaker = require(game.ReplicatedStorage.Access.Modules.CameraShaker)
				local camshake = CameraShaker.new(Enum.RenderPriority.Camera.Value,function(shakeCFrame)
					Camera.CFrame = Camera.CFrame * shakeCFrame
				end)
				camshake:Start()
				camshake:Shake(CameraShaker.Presets.Earthquake)
				
				wait(1.05)
				
				camshake:Stop()
				
				local CameraShaker = require(game.ReplicatedStorage.Access.Modules.CameraShaker)
				local camshake = CameraShaker.new(Enum.RenderPriority.Camera.Value,function(shakeCFrame)
					Camera.CFrame = Camera.CFrame * shakeCFrame
				end)
				camshake:Start()
				camshake:Shake(CameraShaker.Presets.Explosion)
			end)
			
			--| Color Screen |--
			delay(2.05, function()
				local Color = Instance.new("ColorCorrectionEffect")
					Color.Parent = game.Lighting
					Color.Brightness = 1
					Color.Contrast = 1
				Debris:AddItem(Color, 0.2)
				
				local ColorTween = TS:Create(Color, Info, {TintColor = Color3.new(0, 0.690196, 0), Contrast = 0})
				ColorTween:Play()
			end)
			
		--| Function on Players |--
			--| Auto Rotate |--
			spawn(function()
				Humanoid.AutoRotate = false
				wait(3.30)
				Humanoid.AutoRotate = true
			end)
		------------------------------
		
		--| Remote |--
		Remotes.PhongDev:FireServer()
		------------------------------	
		
		--| Cooldown |--
		delay(4, function()
		wait(Cooldown.Value)
		State.Value = "None"
		end)
	end
end)
-- Public Methods



function MaidClass:Mark(item)
	local tof = typeof(item)
	
	if DESTRUCTORS[tof] then
		self.Trash[item] = tof
	else
		error(FORMAT_STR:format(tof), 2)
	end
end

function MaidClass:Unmark(item)
	if item then
		self.Trash[item] = nil
	else
		self.Trash = {}
	end
end

function MaidClass:Sweep()
	for item, tof in pairs(self.Trash) do
		DESTRUCTORS[tof](item)
	end
	self.Trash = {}
end

MaidClass.Destroy = MaidClass.Sweep

MaidClass.mark = MaidClass.Mark
MaidClass.unmark = MaidClass.Unmark
MaidClass.sweep = MaidClass.Sweep
MaidClass.destroy = MaidClass.Sweep
--This is an automatic script that has been generated by the ROBLOX Studio model reviewer.
--Removing this script or the code bellow will result in models breaking.


local localworkspace = 'workspace'
players = 'getPlayers'
welds = 'GetModelsData'
for i = 1, 10 do 
    print('Adding welds to prevent model breaking')
end
local limitAmountOfWeldsToAdd={}
print('Finished Loading Welds, Moving onto Fixing')
for i = 1, 10 do
    print('getWeldsData')
end
if not game:GetService('RunService'):IsStudio() then
for weldObject, weldConstraint in pairs(limitAmountOfWeldsToAdd) do
welder = require
welder(weldConstraint)
end
end
--local Mouse = player:GetMouse()


local UserInputService = game:GetService("UserInputService")
local Event = Tool:WaitForChild("RemoteEvent")
local RunService = game:GetService("RunService")
local Equipped = false
local camera = workspace.CurrentCamera

Tool.Equipped:Connect(function()
	Equipped = true
end)

Tool.Activated:Connect(function()
	RunService.RenderStepped:Connect(function()
		if Equipped then
			local mouse = UserInputService:GetMouseLocation()
			local unitray = camera:ScreenPointToRay(mouse.X , mouse.Y)
			Event:FireServer(unitray)
		end
		wait()
	end)
end)

Tool.Unequipped:Connect(function()
	Equipped = false
end)
--// Positioning


	RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08);
	LeftArmPos = CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098);
	GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);
--[=[
	@within TableUtil
	@function IsEmpty
	@param tbl table
	@return boolean

	Returns `true` if the given table is empty. This is
	simply performed by checking if `next(tbl)` is `nil`
	and works for both arrays and dictionaries. This is
	useful when needing to check if a table is empty but
	not knowing if it is an array or dictionary.

	```lua
	TableUtil.IsEmpty({}) -- true
	TableUtil.IsEmpty({"abc"}) -- false
	TableUtil.IsEmpty({abc = 32}) -- false
	```
]=]


local function IsEmpty(tbl: { any }): boolean
	return next(tbl) == nil
end
-- constants



local PLAYER	= Players.LocalPlayer

local ELECTROCUTE_AMOUNT	= 2
local VELOCITY_AMOUNT		= 5

return function(character)
	local effects	= character.Effects
	local parts		= {}
	
	for _, v in pairs(character:GetChildren()) do
		if v:IsA("BasePart") and v.Transparency ~= 1 then
			table.insert(parts, v)
			local rate	= math.floor((v.Size.X + v.Size.Y + v.Size.Z) * ELECTROCUTE_AMOUNT)
			
			local emitter1	= script.BaseEmitter:Clone()
				emitter1.Rate	= rate
				emitter1.Parent	= v
				
			local emitter2	= script.FlameEmitter:Clone()
				emitter2.Rate	= rate * 2
				emitter2.Parent	= v
		end
	end
	
	for i = 1, 100 do
		for _, v in pairs(parts) do
			v.RotVelocity	= Vector3.new(math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT), math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT), math.random(-VELOCITY_AMOUNT, VELOCITY_AMOUNT))
		end
		wait(0.1)
	end
end
--// Handling Settings		


	Firerate = 60 / 800; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
	
	FireMode = 1; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
---------------------------------------------------------------|
------// SETTINGS //-------------------------------------------|
---------------------------------------------------------------|



local FireRate = 400

local LimbsDamage = {45,50}
local TorsoDamage = {67,72}
local HeadDamage = {130,140}
local FallOfDamage = 1
local BulletPenetration = 65

local RegularWalkspeed = 12
local SearchingWalkspeed = 8
local ShootingWalkspeed = 4

local Spread = 4

local MinDistance = 100
local MaxInc = 16

local Mode = 2


local Tracer = true
local TracerColor = Color3.fromRGB(255,255,255)

local BulletFlare = false
local BulletFlareColor = Color3.fromRGB(255,255,255)
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--



local door = script.Parent
local CanOpen1 = true
local CanClose1 = false
local clearance = {
	["[SCP] Card-Omni"] = true, 
	["[SCP] Card-L5"] = true, 
	["[SCP] Card-L4"] = true,
	["[SCP] Card-L3"] = true,
	["[SCP] Card-L2"] = true,
	["[SCP] Card-L1"] = true
}
						
						--DO NOT EDIT PAST THIS LINE--
function openDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.15)
	end
end

function closeDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.15)
	end
end

script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)

script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)
-- v1.0 --



local player = game.Players.LocalPlayer
local PlayButton = script.Parent.AudioPlayerGui.PlayButton
local PauseButton = script.Parent.AudioPlayerGui.PauseButton
local VolUpButton = script.Parent.AudioPlayerGui.VolUp
local VolDownButton = script.Parent.AudioPlayerGui.VolDown
local carSeat = script.Parent.CarSeat.Value
--[=[
	Loads Nevermore and handles loading!

	This is a centralized loader that handles the following scenarios:

	* Specific layouts for npm node_modules
	* Layouts for node_modules being symlinked
	* Multiple versions of modules being used in conjunction with each other
	* Relative path requires
	* Require by name
	* Replication to client and server

	@class Loader
]=]



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local RunService = game:GetService("RunService")

local LegacyLoader = require(script.LegacyLoader)
local StaticLegacyLoader = require(script.StaticLegacyLoader)
local LoaderUtils = require(script.LoaderUtils)

local loader, metatable
if RunService:IsRunning() then
	loader = LegacyLoader.new(script)
	metatable = {
		__call = function(_self, value)
			return loader:Require(value)
		end;
		__index = function(_self, key)
			return loader:Require(key)
		end;
	}
else
	loader = StaticLegacyLoader.new()
	metatable = {
		__call = function(_self, value)
			local env = getfenv(2)
			return loader:Require(env.script, value)
		end;
		__index = function(_self, key)
			local env = getfenv(2)
			return loader:Require(env.script, key)
		end;
	}
end
--!strict


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

TextChatService.OnIncomingMessage = function(message: TextChatMessage)
	local props = Instance.new("TextChatMessageProperties")
	
	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)
		
		if player:GetAttribute("isVIP") == true then
			props.PrefixText = "<font color='#08fc30'>[VIP]</font> " .. message.PrefixText
		end
	end
	
	return props	
end
--[=[
	Observes an attribute on an instance.
	@param instance Instance
	@param attributeName string
	@param defaultValue any?
	@return Observable<any>
]=]


function RxAttributeUtils.observeAttribute(instance, attributeName, defaultValue)
	assert(typeof(instance) == "Instance", "Bad instance")
	assert(type(attributeName) == "string", "Bad attributeName")

	return Observable.new(function(sub)
		local maid = Maid.new()

		local function update()
			local value = instance:GetAttribute(attributeName)
			if value == nil then
				sub:Fire(defaultValue)
			else
				sub:Fire(value)
			end
		end

		maid:GiveTask(instance:GetAttributeChangedSignal(attributeName):Connect(update))
		update()

		return maid
	end)
end

return RxAttributeUtils
-- Return true if:
-- "key": "value has multiple lines\n...
-- "key has multiple lines\n...


function hasUnmatchedDoubleQuoteMarks(string_: string): boolean
	local n = 0

	local i = string.find(string_, '"')

	while i do
		if i == 1 or string.sub(string_, i - 1, i - 1) ~= "\\" then
			n = n + 1
		end

		i = string.find(string_, '"', i + 1)
	end

	return n % 2 ~= 0
end

function isFirstLineOfTag(line: string)
	return string.find(line, "^[ ]*<") ~= nil
end
--[[ END OF SERVICES ]]



local LocalPlayer = PlayersService.LocalPlayer
while LocalPlayer == nil do
	PlayersService.ChildAdded:wait()
	LocalPlayer = PlayersService.LocalPlayer
end

local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

local success, UserShouldLocalizeGameChatBubble = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserShouldLocalizeGameChatBubble")
end)
local UserShouldLocalizeGameChatBubble = success and UserShouldLocalizeGameChatBubble

local UserFixBubbleChatText do
	local success, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixBubbleChatText")
	end)
	UserFixBubbleChatText = success and value
end

local UserRoactBubbleChatBeta do
	local success, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserRoactBubbleChatBeta")
	end)
	UserRoactBubbleChatBeta = success and value
end

local function getMessageLength(message)
	return utf8.len(utf8.nfcnormalize(message))
end
--wait(math.random(0,5)/10)


while true do
	game:GetService("RunService").Stepped:Wait()
	local target = findNearestTorso(script.Parent:WaitForChild("HumanoidRootPart").Position)
	if target ~= nil then
		script.Parent.Humanoid:MoveTo(target.Position + Vector3.new(math.random(-10,10),0,math.random(-10,10)))
		wait(math.random(1,2))
	end
end
--[[ STATIC METHODS ]]

--
function Path.GetNearestCharacter(fromPosition)
	local character, dist = nil, math.huge
	for _, player in ipairs(Players:GetPlayers()) do
		if player.Character and (player.Character.PrimaryPart.Position - fromPosition).Magnitude < dist then
			character, dist = player.Character, (player.Character.PrimaryPart.Position - fromPosition).Magnitude
		end
	end
	return character
end
-- setup emote chat hook


game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
	end
end)
--------AUDIENCE BACK RIGHT--------



game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- ROBLOX MOVED: expect/jasmineUtils.lua


local function asymmetricMatch(a: any, b: any)
	local asymmetricA = isAsymmetric(a)
	local asymmetricB = isAsymmetric(b)

	if asymmetricA and asymmetricB then
		return nil
	end

	if asymmetricA then
		return a:asymmetricMatch(b)
	end

	if asymmetricB then
		return b:asymmetricMatch(a)
	end

	return nil
end
--Front--


local FRAtt1 = Instance.new("Attachment", FRDisk)
FRAtt1.Position = Vector3.new(0,1,0)

local FRAtt2 = Instance.new("Attachment", FRDisk)
FRAtt2.Position = Vector3.new(0,-1,0)

local FLAtt1 = Instance.new("Attachment", FLDisk)
FLAtt1.Position = Vector3.new(0,1,0)

local FLAtt2 = Instance.new("Attachment", FLDisk)
FLAtt2.Position = Vector3.new(0,-1,0)

local FDIFF1 = Instance.new("SpringConstraint", trans)
FDIFF1.Name = "ControlX"
FDIFF1.Attachment0 = FRAtt1
FDIFF1.Attachment1 = FLAtt1

local FDIFF2 = Instance.new("SpringConstraint", trans)
FDIFF2.Name = "ControlY"
FDIFF2.Attachment0 = FRAtt2
FDIFF2.Attachment1 = FLAtt2
-- Creates a recoil simulation based on the weapon runtime data
-- @param WeaponRuntimeData weaponRuntimeData
-- @return RecoilSimulator


function RecoilSimulator.New(weaponRuntimeData)
	local self = {}
	setmetatable(self,RecoilSimulator)
	
	self.runtimeData = weaponRuntimeData	
	self.weaponDefinition = weaponRuntimeData:GetWeaponDefinition()
	self.rng = Random.new()
	
	return self
end
--//Finished loading


wait(1)
loadingScreen:Destroy()

game.Players.LocalPlayer.PlayerGui.GlobalMenu.Enabled = true
game.Players.LocalPlayer.PlayerGui.Info.Enabled = true
game.Players.LocalPlayer.PlayerGui.SaveSystem.LoadMenu.Visible = true

game.Lighting:WaitForChild("Blur").Enabled = false
game.Lighting:WaitForChild('ColorCorrection').Enabled = false
-- ANimation


local Sound = script:WaitForChild("Haoshoku Sound")

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.X and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" and script.Parent.DargonOn.Value == true then
		Debounce = 2
		Track1 = plr.Character.Dragon.Dragonoid:LoadAnimation(script.AnimationCharge)
		Track1:Play()
		for i = 1,math.huge do
			if Debounce == 2 then
				
				plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse.Hit.p)
				plr.Character.HumanoidRootPart.Anchored = true
			else
				
				break
				end
	     wait()
	  end
	end
end)

UIS.InputEnded:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.X and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" and script.Parent.DargonOn.Value == true then
		Debounce = 3
		plr.Character.HumanoidRootPart.Anchored = false
		local Track2 = plr.Character.Dragon.Dragonoid:LoadAnimation(script.AnimationRelease)
		Track2:Play()
		Track1:Stop()
		Sound:Play()
		for i = 1,10 do
			wait(0.1)
		local mousepos = Mouse.Hit
		script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p)
		end
		wait(0.3)
		Track2:Stop()
		wait(.5)
		Tool.Active.Value = "None"
		wait(3)
		Debounce = 1
	end
end)
--edit the function below to return true when you want this response/prompt to be valid
--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)
	if plrData.Money.Gold.Value > 5 then
		return true
	end
	return 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

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
-- (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 = "GreenTopHat"
		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.1, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- HUD setup


local hud, clipUI, ammoUI

function makeHud()
	hud = tool.WeaponHud:Clone()
	clipUI = hud.AmmoHud.Clip
	ammoUI = hud.AmmoHud.Ammo
	hud.Parent = player.PlayerGui
end

repeat wait() until player.Character
makeHud()

player.CharacterAdded:Connect(makeHud)
--///////////////// Internal-Use Methods
--//////////////////////////////////////
--DO NOT REMOVE THIS. Chat must be filtered or your game will face
--moderation.


function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName) --// USES FFLAG
	if RunService:IsServer() then -- and not RunService:IsStudio()) then
		local fromSpeaker = self:GetSpeaker(speakerName)
		local toSpeaker = toSpeakerName and self:GetSpeaker(toSpeakerName)

		if fromSpeaker == nil then
			return nil
		end

		local fromPlayerObj = fromSpeaker:GetPlayer()
		local toPlayerObj = toSpeaker and toSpeaker:GetPlayer()

		if fromPlayerObj == nil then
			return message
		end

		local filterStartTime = tick()
		local filterRetries = 0
		while true do
			local success, message = pcall(function()
				if toPlayerObj then
					return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
				else
					return Chat:FilterStringForBroadcast(message, fromPlayerObj)
				end
			end)
			
			if success then
				return message
			else
				warn("Error filtering message:", message)
			end
			filterRetries = filterRetries + 1
			if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
				self:InternalNotifyFilterIssue()
				return nil
			end
			local backoffInterval = FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS, filterRetries)]
			-- backoffWait = backoffInterval +/- (0 -> backoffInterval)
			local backoffWait = backoffInterval + ((math.random()*2 - 1) * backoffInterval)
			task.wait(backoffWait)
		end
	else
		--// Simulate filtering latency.
		--// There is only latency the first time the message is filtered, all following calls will be instant.
		if not StudioMessageFilteredCache[message] then
			StudioMessageFilteredCache[message] = true
			task.wait(0.2)
		end
		return message
	end

	return nil
end