Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- (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 = "Top Hat"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(2, 1, 1) 
		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)
-- assume we are in the character, let's check



function sepuku()
	script.Parent = nil
end

local h = script.Parent:FindFirstChild("Humanoid")

if (h == nil) then sepuku() end

local oldSpeed = h.WalkSpeed
h.WalkSpeed = h.WalkSpeed * 1.5




local torso = script.Parent:FindFirstChild("Torso")

if (torso == nil) then sepuku() end


local head = script.Parent:FindFirstChild("Head")
if (head == nil) then head = torso end



local s = Instance.new("Sparkles")
s.Color = Color3.new(0, .8, 0)
s.Parent = torso


local count = h:FindFirstChild("CoffeeCount")
if (count == nil) then
	count = Instance.new("IntValue")
	count.Name = "CoffeeCount"
	count.Value = 1
	count.Parent = h
else
	
	if (count.Value > 3) then
		if (math.random() > .5) then

			local sound = Instance.new("Sound")
			sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
			sound.Parent = head
			sound.Volume = 1
			sound:play()

			local e = Instance.new("Explosion")
			e.BlastRadius = 50
			e.Position = head.Position
			
			s:Clone().Parent = head
			e.Parent = head
			

		end
	end
	count.Value = count.Value + 1
end

wait(10)

h.WalkSpeed = oldSpeed
s:Remove()


script.Parent = nil
--[=[
	@param inboundMiddleware ClientMiddleware?
	@param outboundMiddleware ClientMiddleware?
	@return table
	Returns an object which maps RemoteFunctions as methods
	and RemoteEvents as fields.
	```lua
	-- Server-side:
	serverComm:BindFunction("Test", function(player) end)
	serverComm:CreateSignal("MySignal")
	serverComm:CreateProperty("MyProperty", 10)

	-- Client-side
	local obj = clientComm:BuildObject()
	obj:Test()
	obj.MySignal:Connect(function(data) end)
	obj.MyProperty:Observe(function(value) end)
	```
]=]


function ClientComm:BuildObject(inboundMiddleware: Types.ClientMiddleware?, outboundMiddleware: Types.ClientMiddleware?)
	local obj = {}
	local rfFolder = self._instancesFolder:FindFirstChild("RF")
	local reFolder = self._instancesFolder:FindFirstChild("RE")
	local rpFolder = self._instancesFolder:FindFirstChild("RP")
	if rfFolder then
		for _, rf in ipairs(rfFolder:GetChildren()) do
			if not rf:IsA("RemoteFunction") then
				continue
			end
			local f = self:GetFunction(rf.Name, inboundMiddleware, outboundMiddleware)
			obj[rf.Name] = function(_self, ...)
				return f(...)
			end
		end
	end
	if reFolder then
		for _, re in ipairs(reFolder:GetChildren()) do
			if not re:IsA("RemoteEvent") then
				continue
			end
			obj[re.Name] = self:GetSignal(re.Name, inboundMiddleware, outboundMiddleware)
		end
	end
	if rpFolder then
		for _, re in ipairs(rpFolder:GetChildren()) do
			if not re:IsA("RemoteEvent") then
				continue
			end
			obj[re.Name] = self:GetProperty(re.Name, inboundMiddleware, outboundMiddleware)
		end
	end
	return obj
end
-- Adjust torque and springs based on gravity to keep the car drivable


local function gravityAdjust()
	local defaultGravity = 196.2
	local actualGravity = Workspace.Gravity
	local gravityChange = actualGravity / defaultGravity
	-- Speed is adjusted so that the height of jumps is preserved
	-- So maxSpeed is scaled proportionally to the sqrt of gravity
	ActualDrivingTorque = VehicleParameters.DrivingTorque * gravityChange
	ActualBrakingTorque = VehicleParameters.BrakingTorque * gravityChange

	ActualStrutSpringStiffnessFront = VehicleParameters.StrutSpringStiffnessFront * gravityChange
	ActualStrutSpringDampingFront = VehicleParameters.StrutSpringDampingFront * math.sqrt( gravityChange )
	ActualStrutSpringStiffnessRear = VehicleParameters.StrutSpringStiffnessRear * gravityChange
	ActualStrutSpringDampingRear = VehicleParameters.StrutSpringDampingRear * math.sqrt( gravityChange )

	ActualTorsionSpringStiffness = VehicleParameters.TorsionSpringStiffness * gravityChange
	ActualTorsionSpringDamping = VehicleParameters.TorsionSpringDamping * math.sqrt( gravityChange )
end

local function updateFromConfiguration()
	for property, value in pairs(VehicleParameters) do
		local configProp = VehicleConfig:FindFirstChild(property)
		if configProp then
			if property == "MaxSpeed" or property == "ReverseSpeed" then
				VehicleParameters[property] = configProp.Value/mphConversion -- convert to studs/sec
			else
				VehicleParameters[property] = configProp.Value
			end
		end
	end
end

local updateEvents
if VehicleConfig then
	updateFromConfiguration()

	updateEvents = {}
	local props = VehicleConfig:GetChildren()
	for i = 1, #props do
		updateEvents[props[i].Name] = props[i].Changed:connect(function(value)
			VehicleParameters[props[i].Name] = value
			if DoGravityAdjust then
				gravityAdjust()
			end
			if Chassis then
				Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
			end
		end)
	end
end

if DoGravityAdjust then
	gravityAdjust()
end

workspace.Changed:Connect(function(prop)
	if prop == "Gravity" then
		if DoGravityAdjust then
			gravityAdjust()
		end
		if Chassis then
			Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
		end
	end
end)

local Motors
local SteeringPrismatic
local RedressMount
--[=[
	@param optionB Option
	@return Option
	Returns `optionB` if the calling option has a value,
	otherwise returns None.

	```lua
	local optionA = Option.Some(32)
	local optionB = Option.Some(64)
	local opt = optionA:And(optionB)
	-- opt == optionB

	local optionA = Option.None
	local optionB = Option.Some(64)
	local opt = optionA:And(optionB)
	-- opt == Option.None
	```
]=]


function Option:And(optB)
	if self:IsSome() then
		return optB
	else
		return Option.None
	end
end
--[[
Tool.Handle.Touched:connect(function(part)

	if Tool.Handle.Fire.Enabled == false then
		return
	end
	local children = part:GetChildren()
	for i = 1, #children do
		if children[i].className == "Fire" then
			return
		end
	end
	if part.Parent == player then
		return
	end

	if part.Material ==  Enum.Material.Wood then
		local fire = Tool.Handle.Fire:clone()
		fire.Parent = part
		local light=Tool.Handle.PointLight:clone()
		light.Parent=part
		
		local fireScript = Tool.FireScript:clone()
		fireScript.Parent = part
		fireScript.Disabled = false

		debris:AddItem(fire,35)
		debris:AddItem(light,35)
	end

end)
--]]



Tool.Activated:connect(function()
	Tool.Handle.Fire.Enabled = not Tool.Handle.Fire.Enabled
	Tool.Handle.PointLight.Enabled = not Tool.Handle.PointLight.Enabled
	Tool.Handle.Light:Play()
end)
--[[Running Logic]]

--
local equipped = false
local rayparts = {}

local oldC0 =nil
local nweld


Tool.Equipped:connect(function(mouse)
	wait(0.1)
	--game.Players.LocalPlayer:GetMouse()
	Spawn(function()
		local colorChoice = 1
		if not Tool.Parent:FindFirstChild('Torso') or not Tool.Parent.Head:FindFirstChild('RightWeld') or not Tool.Parent:FindFirstChild('Humanoid') then return end
				hweld = Tool.Parent.Torso['Neck']
		holdC0 = hweld.C0
		equipped = true
		while equipped and Tool.Parent:FindFirstChild('Torso') do
			local tframe = Tool.Parent.Torso.CFrame
			tframe = tframe + tframe:vectorToWorldSpace(Vector3.new(0, 0,0)) 
			local taim = (mouse.Hit.p + (mouse.Hit.lookVector * 300)) -( tframe.p )
		hweld.C0 = (CFrame.new(Vector3.new(0,1,0),tframe:vectorToObjectSpace(taim))*CFrame.Angles(math.rad(-90),0,math.rad(-180)))
		
			
			wait()
		end
		hweld.C0 =holdC0
		
	end)
end)

Tool.Unequipped:connect(function(mouse)
	equipped= false
	if nweld then
		nweld.MaxVelocity =.15
		nweld.C0 =oldC0
	end
	
end)
--[[Engine (Avxnturador)]]



	-- Everything below can be illustrated and tuned with the graph below.
	-- https://www.desmos.com/calculator/oishj9m1tq
	-- This includes everything, from the engines, to boost, to electric.
	
	-- To import engines prior to AC6C V1.3, consult the README.
	
	-- Naturally Aspirated Engine
	Tune.Engine 		= true		
		
		Tune.Horsepower		= 100
		Tune.IdleRPM		= 750
		Tune.PeakRPM		= 5800
		Tune.Redline		= 6000
		Tune.EqPoint		= 5252
		Tune.PeakSharpness	= 10
		Tune.CurveMult		= 0.4
	
	-- Electric Engine
	Tune.Electric		= false
		
		Tune.E_Redline	= 12700
		Tune.E_Trans1	= 4000
		Tune.E_Trans2	= 7000
		-- Horsepower
		Tune.E_Horsepower	= 223
		Tune.EH_FrontMult	= 0.15
		Tune.EH_EndMult		= 2.9
		Tune.EH_EndPercent	= 7
		-- Torque
		Tune.E_Torque		= 286
		Tune.ET_EndMult		= 1.505
		Tune.ET_EndPercent	= 27.5
		
	-- Turbocharger
	Tune.Turbochargers	= 1				-- Number of turbochargers in the engine
										-- Set to 0 for no turbochargers
		Tune.T_Boost		= 25
		Tune.T_Efficiency	= 10
		
		Tune.T_Size			= 1		-- Turbo Size; Bigger size = more turbo lag
		
	-- Supercharger
	Tune.Superchargers	= 0				-- Number of superchargers in the engine
										-- Set to 0 for no superchargers
		Tune.S_Boost		= 7
		Tune.S_Efficiency	= 8.5
		
		Tune.S_Sensitivity	= 0.05		-- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)
		
	--Misc
	Tune.ThrotAccel		= .05		-- Throttle acceleration, applied per tick (recommended values between 0.05 to 0.1)
	Tune.ThrotDecel		= .2		-- Throttle deceleration, applied per tick (recommended values between 0.1 to 0.3)
	
	Tune.BrakeAccel		= .2		-- Brake acceleration, applied per tick
	Tune.BrakeDecel		= .5		-- Brake deceleration, applied per tick
	
	Tune.RevAccel		= 250		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.Flywheel		= 500		-- Flywheel weight (higher = faster response, lower = more stable RPM)
	
	Tune.InclineComp	= 1			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
----///Functions///



function HideChar(char,val)
	for _,v in pairs(char:GetDescendants()) do
		if v:IsA("Part") or v:IsA("MeshPart") then
			if v.Name ~= "HumanoidRootPart" then
				v.Transparency = val
			end
		end
	end
end

VehicleRemotes.LeaveSeat.OnServerEvent:Connect(function(plr) ---Leave seat remote
	if plr.Character.Humanoid.SeatPart ~= nil then
		local VehChair = plr.Character.Humanoid.SeatPart
		VehChair.Disabled = true
	end
end)

VehicleRemotes.EnterSeat.OnServerEvent:Connect(function(plr) ---Enter seat remote
	print("Entered")
	--HideChar(plr.Character,1)
	--plr.Character.Humanoid.JumpPower = 0
end)
--[[**
	asserts a given check

	@param check The function to wrap with an assert

	@returns A function that simply wraps the given check in an assert
**--]]


function t.strict(check)
	return function(...)
		assert(check(...))
	end
end

do
	local checkChildren = t.map(t.string, t.callback)

	--[[**
		Takes a table where keys are child names and values are functions to check the children against.
		Pass an instance tree into the function.
		If at least one child passes each check, the overall check passes.

		Warning! If you pass in a tree with more than one child of the same name, this function will always return false

		@param checkTable The table to check against

		@returns A function that checks an instance tree
	**--]]
	function t.children(checkTable)
		assert(checkChildren(checkTable))

		return function(value)
			local instanceSuccess, instanceErrMsg = t.Instance(value)
			if not instanceSuccess then
				return false, instanceErrMsg or ""
			end

			local childrenByName = {}
			for _, child in pairs(value:GetChildren()) do
				local name = child.Name
				if checkTable[name] then
					if childrenByName[name] then
						return false, string.format("Cannot process multiple children with the same name \"%s\"", name)
					end
					childrenByName[name] = child
				end
			end

			for name, check in pairs(checkTable) do
				local success, errMsg = check(childrenByName[name])
				if not success then
					return false, string.format("[%s.%s] %s", value:GetFullName(), name, errMsg or "")
				end
			end

			return true
		end
	end
end

return t
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


if guntype == 1 then
local torso = model.Parent:FindFirstChild("Torso")
if torso ~= nil then
if weldmode == 1 then--barrel pointing upper-right
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
elseif weldmode == 2 then--barrel pointing upper-left
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
elseif weldmode == 3 then--barrel pointing upside-right
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, -0.1+y, 0.2 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), -1.5)
elseif weldmode == 4 then--barrel pointing upside-left
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1.1, 1)
end
end
------------------------------------------------------------------------------------------------------------------


while true do
	local Frame = MainFrame
	local Engine = Helicopter:FindFirstChild("Engine")
	wait()
	Frame.ALT.Text = ' ALTITUDE: ' .. math.floor(Helicopter.Engine.Position.Y -5)
	Frame.SPD.Text = " SPEED:  ".. math.floor(Engine.Velocity.Magnitude).." SPS"
	Frame.TASPEED.Text = "V SPEED: ".. math.floor(Engine.Velocity.Y).." SPS"
	Frame.ZZ.Text = "THROTTLE: "..Helicopter.Pilot.Throttle.Value.." %"
end
-- Customization


	AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false)
	
	MouseSense = 0.5;

	CanAim = true; -- Allows player to aim
	CanBolt = false; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series)
	
	LaserAttached = true;
	LightAttached = true;
	TracerEnabled = true;
	
	SprintSpeed = 21;
-- # CODE BELOW # --
-- ^    Do not change anything else



local GoreFolder = game.ReplicatedStorage["Gore by Leveled Development"];
local Core = require(GoreFolder.Modules.Core);

function Asset(Player)
	local Character = Player.Character;
	local Gibs = script.Gibs;
	local GibParts = {
		["Head"] = {Gibs["Head"]:Clone(), Character["Head"]},
		["LeftArm"] = {Gibs["LeftArm"]:Clone(), Character["Left Arm"]},
		["RightArm"] = {Gibs["RightArm"]:Clone(), Character["Right Arm"]},
		["LeftLeg"] = {Gibs["LeftLeg"]:Clone(), Character["Left Leg"]},
		["RightLeg"] = {Gibs["RightLeg"]:Clone(), Character["Right Leg"]}
	};
	
	for Int, Parts in pairs(GibParts) do
		Parts[1].Parent = Parts[2];
		Parts[1].CFrame = Parts[2].CFrame;
		Core.WeldTo(Parts[2], Parts[1]);
	end;
	
	if not Character:FindFirstChild("Humanoid") then
		repeat wait() until Character:FindFirstChild("Humanoid");
	end;
	if not Character:FindFirstChild("Humanoid"):FindFirstChild("HumanoidDescription") then
		repeat wait() until Character:FindFirstChild("Humanoid"):FindFirstChild("HumanoidDescription");
	end;
	
	GibParts["Head"][1]["Main"].Color = Character.Humanoid.HumanoidDescription.HeadColor;
	GibParts["LeftArm"][1]["Main"].Color = Character.Humanoid.HumanoidDescription.LeftArmColor;
	GibParts["RightArm"][1]["Main"].Color = Character.Humanoid.HumanoidDescription.RightArmColor;
	GibParts["LeftLeg"][1]["Main"].Color = Character.Humanoid.HumanoidDescription.LeftLegColor;
	GibParts["RightLeg"][1]["Main"].Color = Character.Humanoid.HumanoidDescription.RightLegColor;
end;

game.Players.PlayerAdded:Connect(function(Player)
	if not Player.Character then
		Player.CharacterAdded:Wait();
	end;
	Asset(Player);
	while wait() do
		if Player.Character:FindFirstChild("Head") then
			if not Player.Character.Head:FindFirstChild("Head") then
				Asset(Player);
			end;
		end;
	end;
end);
--Set up input changed class for controllers.


local ControllerDown = false
table.insert(EventsToDisconnect,UserInputService.InputChanged:Connect(function(Input,Processed)
	if Processed then return end
	local Character = Player.Character
	if not Character then return end
	local Humanoid = Character:FindFirstChildOfClass("Humanoid")
	if not Humanoid or Humanoid.Health <= 0 then return end
	
	--Disconnect the event if the tool is unparented.
	DisconnectEvents()
	
	--Handle input if it is the right trigger.
	if (Input.UserInputType == Enum.UserInputType.Gamepad1 or Input.UserInputType == Enum.UserInputType.Gamepad2) and Input.KeyCode == Enum.KeyCode.ButtonR2 then
		local ShouldBeDown = (Input.Position.Z > 0.8)
		
		if ShouldBeDown and not ControllerDown then
			--If it is 80% down and it was up, set it down.
			ControllerDown = true
			
			if VRService.VREnabled then
				--The camera's CFrame is used with VR.
				--For a VR version, a more robust implemention should be done.
				local CameraCF = Camera.CFrame
				local Position = CastRay(CameraCF.p,CameraCF.lookVector,1000)
				LongInputBeganEvent:Fire(Position)
				InputBeganEvent:Fire(Position)
			else
				--The center mouse is used with controllers.
				local Position = Get3DPosition(Mouse.X,Mouse.Y)
				LongInputBeganEvent:Fire(Position)
				InputBeganEvent:Fire(Position)
			end
		elseif not ShouldBeDown and ControllerDown then
			--If it is not 80% down and it was down, set it to up.
			ControllerDown = false
			
			if VRService.VREnabled then
				--The camera's CFrame is used with VR.
				--For a VR version, a more robust implemention should be done.
				local CameraCF = Camera.CFrame
				InputEndedEvent:Fire(CastRay(CameraCF.p,CameraCF.lookVector,1000))
			else
				--The center mouse is used with controllers.
				InputEndedEvent:Fire(Get3DPosition(Mouse.X,Mouse.Y))
			end
		end
	end
end))
--[[
    Creates an explosion at part's position, with specified radius. Destroys any tagged tiles within range
]]


local CollectionService = game:GetService("CollectionService")
local Debris = game:GetService("Debris")

return function(part, radius, tagName)
	if not part or not part.Parent then
		return
	end

	local position = part.Position

	local sound = part:FindFirstChild("Explode")

	if sound then
		sound.PlayOnRemove = true
	end

	local explosion = Instance.new("Explosion")
	explosion.Position = position
	explosion.BlastPressure = 0
	explosion.BlastRadius = radius
	explosion.Parent = part

	Debris:AddItem(part, 0.25)

	for _, tile in pairs(CollectionService:GetTagged(tagName)) do
		if tile and tile:IsDescendantOf(workspace) then
			local distance = (tile.Position - position).magnitude
			if distance <= radius then
				tile.Transparency = 0.5
				tile.Anchored = false
				Debris:AddItem(tile, 3)
			end
		end
	end
end
-- Create component


local Component = Cheer.CreateComponent('BTNotificationsManager', View);

function Component.Start(Core)

	-- Display update notification if tool is outdated
	if Core.IsVersionOutdated() then
		if Core.Mode == 'Plugin' then
			Cheer(View.PluginUpdateNotification).Start(Component.AdjustLayout);
		elseif Core.Mode == 'Tool' then
			Cheer(View.ToolUpdateNotification).Start(Component.AdjustLayout);
		end;
	end;

	-- Display HttpEnabled warning if HttpService is disabled
	if not Core.SyncAPI:Invoke('IsHttpServiceEnabled') then
		Cheer(View.HttpDisabledWarning).Start(Component.AdjustLayout);
	end;

	-- Adjust layout
	View.UIListLayout:ApplyLayout();

	-- Animate opening
	View.Position = UDim2.new(0.5, 0, 1.5, 0);
	View.Visible = true;
	View:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), nil, nil, 0.2);

	-- Destroy notifications container on tool unequip
	Spawn(function ()
		Core.Disabling:wait();
		View:Destroy();
	end);

	-- Return component for chaining
	return Component;

end;

function Component.AdjustLayout()
	View.UIListLayout:ApplyLayout();
end;

return Component;
--local tweenmenu = TweenService:Create(
--    script.Parent.Parent.Frame,
--    TweenInfo.new(0.3),
--    {
--        Rotation = 0;
--        Size = UDim2.new(0.5, 50,0.506, 50)
--    }
--)
--
--local tweenmenuclose = TweenService:Create(
--    script.Parent.Parent.Frame,
--    TweenInfo.new(0.3),
--    {
--        Rotation = 0;
--        Size = UDim2.new(0, 0,0, 0)
--    }
--)
--[[Misc]]


	Tune.LoadDelay		= 1.0		-- Delay before initializing chassis (in seconds)
	Tune.AutoStart		= false		-- Set to false if using manual ignition plugin
	Tune.AutoFlip		= true		-- Set to false if using manual flip plugin
	Tune.AutoUpdate		= true		-- Automatically applies minor updates to the chassis if any are found.
									-- Will NOT apply major updates, but will notify you of any.
									-- Set to false to mute notifications, or if using modified Drive.
--[[
    Returns the ServerPlayerComponents of players that are still in state 'game'
]]


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

local PlayerManager = require(ServerStorage.Source.Managers.PlayerManager)

return function(returnComponents)
	local players = {}
	for _, playerComponent in pairs(PlayerManager.getAllPlayers()) do
		if playerComponent.player and playerComponent:getStatus("currentState") == "game" then
			if playerComponent.player:IsDescendantOf(Players) then
				table.insert(players, returnComponents and playerComponent or playerComponent.player)
			end
		end
	end
	return players
end
--


	-- Selection and deselection

bin.Selected:connect(function()
	
	selected = true
	
end)

bin.Deselected:connect(function()
	
	selected = false
	
end)

	-- End selection and deselection

mouse.Button1Down:connect(function()
	
	if not deb and selected then
		
		deb = true
		
		inRemote:FireServer("Mouse1")
		
		wait(.1)
		
		deb = false
		
	end
	
end)
--// Handling Settings		


	Firerate = 60 / 900; -- 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
--// Handling Settings		


	Firerate = 60 / 850; -- 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
--[[
	Returns a list of an object's descendants
	
	INPUT: Object object
	OUTPUT: Table descendants
--]]



return function(object)
	local list = {}
	
	local search;search = function(parent)
		for index, child in next, parent:GetChildren() do
			table.insert(list, child)
			search(child)
		end
	end
	
	search(object)
	
	return list
end
--Made by Luckymaxer



Model = script.Parent

Debris = game:GetService("Debris")

FadeRate = 0.025
Rate = (1 / 15)

Removing = false

function RemoveModel()
	if Removing then
		return
	end
	local Parts = {}
	for i, v in pairs(Model:GetChildren()) do
		if v:IsA("Model") then
			table.insert(Parts, v)
		end
	end
	if #Parts == 0 then
		Removing = true
		Model.Name = ""
		Debris:AddItem(Model, 0.5)
	end
end

Model.ChildRemoved:connect(function(Child)
	RemoveModel()
end)

wait(1.5)

RemoveModel()
------------------------------------------------



UIS.InputBegan:Connect(function(input, processed)
	if not processed then
		if UIS:IsKeyDown(Enum.KeyCode.LeftShift)  then
			if UIS:IsKeyDown(Enum.KeyCode.C) then
				if freeCamEnabled then
					ExitFreecam()
				else
					EnterFreecam()
				end
			end
		end
	end
end)