Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Made by Luckymaxer



Debris = game:GetService("Debris")
RunService = game:GetService("RunService")

Character = script.Parent

Humanoid = Character:FindFirstChild("Humanoid")

Smoke = script:FindFirstChild("Smoke")

function DestroyScript()
	Debris:AddItem(script, 0.5)
end

if not Smoke or not Humanoid or Humanoid.Health > 0 then
	return
end

PartsEffected = {}

for i, v in pairs(Character:GetChildren()) do
	if v:IsA("BasePart") and v.Transparency < 1 then
		v.Velocity = (v.Velocity + (CFrame.Angles((math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01)).lookVector * math.random(1, 5)))
		v.RotVelocity = Vector3.new((math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01), (math.random(-360, 360) * 0.01))
		for ii, vv in pairs(v:GetChildren()) do
			if vv:IsA("ParticleEmitter") then
				vv:Destroy()
			end
		end
		local SmokeEffect = Smoke:Clone()
		SmokeEffect.Enabled = true
		SmokeEffect.Parent = v
		table.insert(PartsEffected, {Part = v, Smoke = SmokeEffect})
	end
end

FadeLoop = RunService.Stepped:connect(function(Time, Step)
	if #PartsEffected == 0 then
		if FadeLoop then
			FadeLoop:disconnect()
			return
		end
	else
		for i, v in pairs(PartsEffected) do
			if v.Part.Transparency < 1 then
				v.Part.Transparency = (v.Part.Transparency + 0.01)
				if v.Part.Transparency >= 1 then
					v.Smoke.Enabled = false
					Debris:AddItem(v.Part, 4)
				end
			else
				table.remove(PartsEffected, i)
			end
		end
	end
end)
--[=[
	@param name string
	@param inboundMiddleware ClientMiddleware?
	@param outboundMiddleware ClientMiddleware?
	@return ClientRemoteSignal
	Returns a new ClientRemoteSignal that mirrors the matching RemoteSignal created by
	ServerComm with the same matching `name`.

	```lua
	local mySignal = clientComm:GetSignal("MySignal")

	-- Listen for data from the server:
	mySignal:Connect(function(message)
		print("Received message from server:", message)
	end)

	-- Send data to the server:
	mySignal:Fire("Hello!")
	```
]=]


function ClientComm:GetSignal(
	name: string,
	inboundMiddleware: Types.ClientMiddleware?,
	outboundMiddleware: Types.ClientMiddleware?
)
	return Comm.GetSignal(self._instancesFolder, name, inboundMiddleware, outboundMiddleware)
end
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --




while wait() do
	
	-- -- -- -- -- -- --
	--DIRECTION SCROLL--
	-- -- -- -- -- -- --
	if Lift:WaitForChild("Direction").Value == 1 then
		This.Display.ARW1.U.BrickColor = BrickColor.new(ActiveARWColour)
		This.Display.ARW1.U.Material = "Neon"
		This.Display.ARW1.D.BrickColor = BrickColor.new(InactiveColour)
		This.Display.ARW1.D.Material = "SmoothPlastic"
	elseif Lift:WaitForChild("Direction").Value == -1 then
		This.Display.ARW1.U.BrickColor = BrickColor.new(InactiveColour)
		This.Display.ARW1.U.Material = "SmoothPlastic"
		This.Display.ARW1.D.BrickColor = BrickColor.new(ActiveARWColour)
		This.Display.ARW1.D.Material = "Neon"
	else
		This.Display.ARW1.U.BrickColor = BrickColor.new(InactiveColour)
		This.Display.ARW1.U.Material = "SmoothPlastic"
		This.Display.ARW1.D.BrickColor = BrickColor.new(InactiveColour)
		This.Display.ARW1.D.Material = "SmoothPlastic"
	end
	
	if Lift:WaitForChild("Mode").Value ~= "fire" then
		This.Legend.SurfaceGui.OOS.TextColor3 = Color3.fromRGB(54, 54, 54)
	else
		This.Legend.SurfaceGui.OOS.TextColor3 = Color3.fromRGB(255, 170, 0)
	end
	
	if Lift.Car.Sensor:FindFirstChild("Overloaded") then
		if Lift.Car.Sensor.Overloaded.Value == true then
			This.Legend.SurfaceGui.FULL.TextColor3 = Color3.fromRGB(255, 170, 0)
		else
			This.Legend.SurfaceGui.FULL.TextColor3 = Color3.fromRGB(54, 54, 54)
		end
	end
	
end
-- Maid object:



local Maid = {
	-- _cleanup_tasks = {},
	-- _is_cleaned = false,
}
Maid.__index = Maid

function Maid:AddCleanupTask(task)
	if self._is_cleaned == true then
		PerformCleanupTask(task)
		return function() end
	elseif type(task) == "function" then
		table.insert(self._cleanup_tasks, task)
	elseif typeof(task) == "RBXScriptConnection" then
		table.insert(self._cleanup_tasks, task)
	elseif typeof(task) == "Instance" then
		table.insert(self._cleanup_tasks, task)
	elseif type(task) == "table" then
		if type(task.Destroy) == "function" then
			table.insert(self._cleanup_tasks, task)
		elseif type(task.Disconnect) == "function" then
			table.insert(self._cleanup_tasks, task)
		else
			error("[MadworkMaid]: Received object table as cleanup task, but couldn't detect a :Destroy() method")
		end
	else
		error("[MadworkMaid]: Cleanup task of type \"" .. typeof(task) .. "\" not supported")
	end
	return function(...)
		self:RemoveCleanupTask(task)
		PerformCleanupTask(task, ...)
	end
end

function Maid:RemoveCleanupTask(task)
	local cleanup_tasks = self._cleanup_tasks
	local index = table.find(cleanup_tasks, task)
	if index ~= nil then
		table.remove(cleanup_tasks, index)
	end
end

function Maid:CleanupOfOne(task, ...)
	self:RemoveCleanupTask(task)
	PerformCleanupTask(task, ...)
end

function Maid:Cleanup(...)
	for _, task in ipairs(self._cleanup_tasks) do
		PerformCleanupTask(task, ...)
	end
	self._cleanup_tasks = {}
	self._is_cleaned = true
end
----------------------------------------------------------------[SS6] TO ADJUST ANY OF THE STEERING OPTIONS, GO TO LINE 66 "--change"


ssl = carSeat.Parent.Parent.LW.WheelML
ssr = carSeat.Parent.Parent.RW.WheelMR
strlckL = 1
strlckR = 1
strspd = script.Parent.Storage.SteerSpeed.Value 
strprg = 0 
maxlockL = carSeat.Storage.SteeringAngle.Value 
maxlockR = carSeat.Storage.SteeringAngle.Value
m = false occ = false n = false
steer = 0
if carSeat.Steer == 1 then
strlckL = math.rad(maxlockL+4)
strlckR = math.rad(maxlockR+6)
elseif carSeat.Steer == -1 then
strlckL = math.rad(maxlockL+6)
strlckR = math.rad(maxlockR+4)
end


while wait() do
	spd = carSeat.Velocity.Magnitude
	steer = (steer+((carSeat.Steer-steer)*strspd))
	carSeat.Parent.Parent.LW.WheelML.Gyro.cframe = carSeat.Parent.ref.CFrame * CFrame.Angles(0,((-1*steer)*strlckL)*(strprg/(spd+strprg)),0)
	carSeat.Parent.Parent.RW.WheelMR.Gyro.cframe = carSeat.Parent.ref.CFrame * CFrame.Angles(0,((-1*steer)*strlckR)*(strprg/(spd+strprg)),0)
	carSeat.Parent.Parent.LW.ML.HingeConstraint.MotorMaxTorque = 0
	carSeat.Parent.Parent.RW.MR.HingeConstraint.MotorMaxTorque = 0
	
	if carSeat.Throttle == 0 then
		strspd = script.Parent.Storage.SteerSpeed.Value*4.3
	end
	
	ssl.Gyro.D = damp
ssl.Gyro.maxTorque = Vector3.new(0,maxtq,0)
ssl.Gyro.P = pw
ssr.Gyro.D = damp
ssr.Gyro.maxTorque = Vector3.new(0,maxtq,0)
ssr.Gyro.P = pw

	if spd < 140 then
		strprg = 160
	else
		strprg = 80*ty
	end
	
	if carSeat.Storage.Mode == "City" then
	ty = 0.005
	else
	ty = 1		
	end
	if script.Parent.Storage.CurrentGear.Value == 2  and carSeat.Steer == 0 then 
		damp = 800
maxtq = 30000
pw = 100000
	else 
	damp = 1000 --change
maxtq = 3000 --change
pw = 10000 --change	
	end
	
	--if script.Parent.Storage.CurrentGear.Value == 2  and carSeat.Steer == 0 then 
		--if m == false then
	--	m = true occ = true n = true
-- Implements Javascript's `Map.prototype.forEach` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach


function Map:forEach<K, V>(callback: callbackFn<K, V> | callbackFnWithThisArg<K, V>, thisArg: Object?): ()
	if typeof(callback) ~= "function" then
		error("callback is not a function")
	end

	return Array.forEach(self._array, function(key: K)
		local value: V = self._map[key] :: V

		if thisArg ~= nil then
			(callback :: callbackFnWithThisArg<K, V>)(thisArg, value, key, self)
		else
			(callback :: callbackFn<K, V>)(value, key, self)
		end
	end)
end

function Map:has(key): boolean
	return self._map[key] ~= nil
end

function Map:keys()
	return self._array
end

function Map:values()
	return Array.map(self._array, function(key)
		return self._map[key]
	end)
end

function Map:entries()
	return Array.map(self._array, function(key)
		return { key, self._map[key] }
	end)
end

function Map:ipairs()
	return ipairs(self:entries())
end

function Map.__index(self, key)
	local mapProp = rawget(Map, key)
	if mapProp ~= nil then
		return mapProp
	end

	return Map.get(self, key)
end

function Map.__newindex(table_, key, value)
	table_:set(key, value)
end

local function coerceToMap(mapLike: Map<any, any> | Table<any, any>): Map<any, any>
	return instanceOf(mapLike, Map) and mapLike :: Map<any, any> -- ROBLOX: order is preservered
		or Map.new(Object.entries(mapLike)) -- ROBLOX: order is not preserved
end

local function coerceToTable(mapLike: Map<any, any> | Table<any, any>): Table<any, any>
	if not instanceOf(mapLike, Map) then
		return mapLike
	end

	-- create table from map
	return Array.reduce(mapLike:entries(), function(tbl, entry)
		tbl[entry[1]] = entry[2]
		return tbl
	end, {})
end

return {
	Map = Map,
	coerceToMap = coerceToMap,
	coerceToTable = coerceToTable,
}
--[[
Runs the fire animation.
--]]


function EggCreator:PlayLaunchAnimation()
	--Launch the arm.
	ReleaseMotor.DesiredAngle = 3
	wait(ANIMATION_TIME)
	Egg.Transparency = 1

	--Delay the animation.
	wait(ANIMATION_DELAY_TIME)
	
	--Reset the arm.
	ReleaseMotor.DesiredAngle = 0
	wait(ANIMATION_TIME)
	
	--Reset the egg.
	wait(RELOAD_TIME - (2* ANIMATION_TIME) - ANIMATION_DELAY_TIME)
	Egg.Transparency = 0	
end



return EggCreator
--Handles the ball being touched.


local function SlingshotBallHit(TouchPart)
	if TouchPart.Name == "Handle" or not TouchPart.Parent then return end
	
	local HitHumanoid = TouchPart.Parent:FindFirstChild("Humanoid")
	if HitHumanoid and HitHumanoid.Parent ~= LastHitCharacter then
		if SLINGSHOT_START_DAMAGE == CurrentDamage and TouchPart.Parent == FiredCharacter then 
			return 
		end
		
		LastHitCharacter = HitHumanoid.Parent
		PlayerDamager:DamageHumanoid(GetReflectedByPlayer() or FiredPlayer,HitHumanoid,CurrentDamage,GetDamageName())
	else
		if not TouchPart.CanCollide then return end
		CurrentDamage = CurrentDamage/1.42
		
		if CurrentDamage < 1 and TouchConnection then
			TouchConnection:disconnect()
			TouchConnection = nil
			SlingshotBall:Destroy()
		end
	end
end
-- Make signal strict


setmetatable(Signal, {
	__index = function(_tb, key)
		error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(_tb, key, _value)
		error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end,
})

return {
	new = Signal.new,
}
--[=[
	Use to determine if the given GuiObject or Rect is within the other
	GuiObject or Rect. This will fail if part of the given GuiObject or Rect
	extends beyond the extents of the other GuiObject or Rect.

	This can be useful in making sure child UI elements do not accidentally leak
	outside of their containers.

	```lua
	expect(a).toBeInside(b) --  Jest
	expect(a).to.be.inside(b) -- TestEZ
	```

	![Example of inside(a, b)](/inside(a,%20b).png)

	@tag relationship
	@within CollisionMatchers2D
]=]


local function inside(a: GuiObject | Rect, b: GuiObject | Rect)
	local aRect = toRect(a)
	local bRect = toRect(b)

	return returnValue(
		isPointInside(aRect.Min, bRect) and isPointInside(aRect.Max, bRect),
		"Is inside the element",
		"Is not inside the element"
	)
end

return inside
--onselected, save shoulders and get player


script.Parent.Equipped:connect(function()
	if selected then return end
	selected = true
	player = game.Players:playerFromCharacter(script.Parent.Parent)
	local ch = script.Parent.Parent
	WaitForChild(ch, "Torso")
	RSH = WaitForChild(ch.Torso, "Right Shoulder")
	LSH = WaitForChild(ch.Torso, "Left Shoulder")
	GRP = WaitForChild(ch["Right Arm"], "RightGrip")
	_G.Grip = GRP
	--
	RSH.Part1 = nil
	LSH.Part1 = nil
	--
	RW.Part0 = ch.Torso
	RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
	RW.C1 = CFrame.new(0, 0.5, 0)
	RW.Part1 = ch["Right Arm"]
	RW.Parent = ch.Torso
	_G.R = RW
	--
	LW.Part0 = ch.Torso
	LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
	LW.C1 = CFrame.new(0, 0.5, 0)
	LW.Part1 = ch["Left Arm"]
	LW.Parent = ch.Torso
	_G.L = LW
	--
	--GRP.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
	--Bring_Arm_Up animation
	for i = 0, 1, 0.05 do
		wait()
		RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.5*i, 0, -0.5*i)
		LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.6*i, 0, 0.7*i)	
		LW.C1 = CFrame.new(-0.3*i, 1.7*i, 0)
	end
	--put in grip
	wait()
	local rg = (ch["Right Arm"]:FindFirstChild("RightGrip") or GRP)
	if rg ~= GRP then
		GRP.Parent = ch["Right Arm"]
		rg:remove()
	end
end)
-- ROBLOX TODO: Uncomment this type once Luau has supported ... syntax
-- type Function = (...) -> any;
-- ROBLOX TODO: Fix once Luau has support for default type arguments


type MockDefaultY = Array<any>
type MockFunctionState<T, Y> = {
	calls: Array<Y>,
	instances: Array<T>,
	invocationCallOrder: Array<number>,
	results: Array<MockFunctionResult>,
}
--Get User Input


game:GetService("UserInputService").InputBegan:Connect(function(InputObj)
	if InputObj.UserInputType == Enum.UserInputType.Keyboard then
		if InputObj.KeyCode == EnterKey then
			if AdornedSeat then
				EnterStart("Keyboard")
			else
				ExitSeat()
			end
		end
	elseif InputObj.KeyCode == EnterButton then
		if AdornedSeat then
			EnterStart("Gamepad")
		else
			ExitSeat()
		end
	end	
end)

game:GetService("UserInputService").InputEnded:Connect(function(InputObj)
	if InputObj.UserInputType == Enum.UserInputType.Keyboard then
		if InputObj.KeyCode == EnterKey then
			EnterKeyDown = false
		end
	elseif InputObj.KeyCode == EnterButton then
		if AdornedSeat then
			EnterKeyDown = false
		end
	end	
end)
--timer.Value = timer.MaxValue -- refresh added


timer.Value = timer.MaxValue
if child:IsA("BasePart") then
petalz(child.Position) 
end	
end
function OnAdded2(child)
	
	for d = 1, 10 do
		wait(0.1)
			if child:IsA("BasePart") then
				if d == 10 then
					child:Destroy()
				else
				child.Transparency = child.Transparency + 0.1
				end
			end
	end

end
function OnRemoved(child)
if child:IsA("BasePart") then
			str.Value = str.Value  + 1
petalz(child.Position) 
end	
end

script.Parent.ChildAdded:connect(OnAdded)
script.ChildAdded:connect(OnAdded2)
script.Parent.ChildRemoved:connect(OnRemoved)

while script ~= nil do 
	wait(1)
	timer.Value = timer.Value - 1
	if timer.Value == 0 and not script.Parent:findFirstChild("Action") then
		z = script.Parent:GetChildren() 
		for i= 1, #z do 
		if z[i]:IsA("BasePart") and z[i].Name ~= "Eye" and z[i].Name ~= "Ear"  then
			z[i]:Destroy() 
		end
		end 
	end
end
---------------------------------------------------



This = script.Parent
Elevator = This.Parent.Parent.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
    if CustomText[tonumber(SF)] then
        SF = CustomText[tonumber(SF)]
    end
    SetDisplay(2,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))        
    SetDisplay(3,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
    if This.Display:FindFirstChild("Matrix"..ID) and Characters[CHAR] ~= nil then
         for i,l in pairs(Characters[CHAR]) do 
            for r=1,5 do    
                This.Display["Matrix"..ID]["Row"..i]["D"..r].Visible = (l:sub(r,r) == "1" and true or false)
            end
        end
    end
end

for M = 1, Displays do
    for R = 1, 7 do
        for D = 1, 5 do
            This.Display["Matrix"..M]["Row"..R]["D"..D].ImageColor3 = DisplayColor
        end
    end
end
---------------------------------------------------



This = script.Parent
Lift = This.Parent.Parent.Parent
CustomLabel = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Lift:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do 
			for r=1,7 do	
				This.Display["DIG"..ID]["D"..r].BrickColor = (l:sub(r,r) == "1" and BrickColor.new("Institutional white") or BrickColor.new("Really black"))
			end
		end
	end
end
-- regeneration


function regenHealth()
	if Humanoid.Health == 0 then -- Ded
		regening = false 
		z = Figure:GetChildren() 
		for i= 1, #z do 
			if z[i].ClassName == "Shirt" or z[i].ClassName == "Pants" or z[i].ClassName == "Body Colors" then
				z[i]:Destroy()		
			elseif z[i].ClassName == "Part" then
				part = z[i]		
				part.Transparency = 0.5
				part.BrickColor = BrickColor.new("Deep orange")
				part.Reflectance = 0.2
				lit = Instance.new("PointLight", part)
				lit.Color = Color3.new(1,187/255,28/255)
				bv = Instance.new("BodyVelocity", part)
				bv.velocity = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) 
				part.RotVelocity =  Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) 
			elseif z[i].ClassName == "Hat" then
				part = z[i].Handle
				part.Mesh.TextureId = "" 
				part.Transparency = 0.5
				part.Reflectance = 0.2
				part.BrickColor = BrickColor.new("Deep orange")
				lit = Instance.new("PointLight", part)
				lit.Color = Color3.new(1,187/255,28/255)
				bv = Instance.new("BodyVelocity", part)
				bv.velocity = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) 
				part.RotVelocity =  Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) 
			end
		end 
		for l = 1, 10 do
			wait(0.3)
				for i= 1, #z do 
				if z[i].ClassName == "Part" then
					z[i].Transparency = z[i].Transparency + 0.08
				elseif z[i].ClassName == "Hat" then
					z[i].Handle.Transparency = z[i].Handle.Transparency + 0.08
					 
				end
			end 
		end
		Figure:Destroy() 
	end
	if regening then return end
	regening = true
	
	while Humanoid.Health < Humanoid.MaxHealth do
		local s = wait(1)
		local health = Humanoid.Health
		if health > 0 and health < Humanoid.MaxHealth then
			local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
			health = health + newHealthDelta
			Humanoid.Health = math.min(health,Humanoid.MaxHealth)
		end
		if Humanoid.Health == 0 then
			game.Debris:AddItem(Figure, 6) 
		end
		
	end
	
	if Humanoid.Health > Humanoid.MaxHealth then
		Humanoid.Health = Humanoid.MaxHealth
	end
	
	
	regening = false
end
local ourtool = nil
function Check()
 tool = nil
		z = char:GetChildren() 
		for i= 1, #z do 
		if z[i].ClassName == "Tool" then
		tool = z[i]
		end
		end 
		if tool == nil then
			if ourtool ~= nil then
			ourtool:Destroy()
			ourtool = nil
			end 
		else
			ourtool = tool:clone()
			ourtool.Parent = Figure
			Humanoid:EquipTool(ourtool)
		end
end
Check()
char.ChildAdded:connect(Check)
char.ChildRemoved:connect(Check)
Humanoid.HealthChanged:connect(regenHealth)
-- placed these in here cause yolo


wait(0.1)


ship = script.Parent

r = math.random(1,4)
if r == 1 then
	script.Rocky.angularvelocity = Vector3.new(0.1,0,0)	
elseif r == 2 then
	script.Rocky.angularvelocity = Vector3.new(-0.1,0,0)	
elseif r == 3 then
	script.Rocky.angularvelocity = Vector3.new(0,0,0.1)	
elseif r == 4 then
	script.Rocky.angularvelocity = Vector3.new(0,0,-0.1)
end
script.Rocky:clone().Parent = ship.Engine
ship.Engine.BodyGyro.maxTorque = Vector3.new(0,math.huge,0)
wait(2)
ship.Engine.BodyGyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
ship.Engine.Rocky:Destroy()
wait(1)
script:Destroy()
--[[
	Cam Hook
	Allows for clicking and viewing a part
	Phoenix
]]



local Remote = game:GetService("ReplicatedStorage").Game.Events.Game.CameraListener

return function(Environment, ID, Settings)
	script = Environment
	
	local Settings = require(Settings)
	local Players  = {}
	
	script.Parent.MouseClick:Connect(function(Player)
		if Player.Character ~= nil then
			if Player.Character.Humanoid.WalkSpeed > 0 and Player.Character.Humanoid.Health > 0 then
				Players[Player.Name] = Player
				Remote:FireClient(Player, ID, Settings)
			end
		end
	end)
	
	Remote.OnServerEvent:Connect(function(Player, ToID, Command)
		if ToID  == ID then
			if Players[Player.Name] ~= nil then
				if Command == "Finish" then
					Players[Player.Name] = nil
					Player.Character:WaitForChild("HumanoidRootPart").Anchored = false
				elseif Command == "Freeze" then
					Player.Character:WaitForChild("HumanoidRootPart").Anchored = true
				elseif Command == "Resume" then
					Player.Character:WaitForChild("HumanoidRootPart").Anchored = false
				end
			end
		end
	end)
end;
--///////////////// 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 _SETTINGS.DisableSafeChat == true then
		return message
	else
		if (RunService:IsServer() 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)
				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
				wait()
			end
			return message
		end
	end
	return nil
end
-- Implements Javascript's `Array.prototype.map` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some


return function<T, U>(t: Array<T>, callback: callbackFn<T> | callbackFnWithThisArg<T, U>, thisArg: U?): boolean
	if typeof(t) ~= "table" then
		error(string.format("Array.some called on %s", typeof(t)))
	end
	if typeof(callback) ~= "function" then
		error("callback is not a function")
	end

	for i, value in t do
		if thisArg ~= nil then
			if value ~= nil and (callback :: callbackFnWithThisArg<T, U>)(thisArg, value, i, t) then
				return true
			end
		else
			if value ~= nil and (callback :: callbackFn<T>)(value, i, t) then
				return true
			end
		end
	end
	return false
end
--[[
	Discord - Roblox hookup
	ConfidentCoding
	Do not touch this script.
--]]



local webHook = {}
webHook.__index = webHook

function webHook.new(id,key) 
	local mt = setmetatable({id=id,key=key}, webHook) 
	return mt
end

function webHook:post(config,host)
	local data = nil
	local success = pcall(function()
		data = game:GetService("HttpService"):JSONEncode(config)
	end)
	if not success then warn("Webhook can't be converted to JSON") return end
	game:GetService("HttpService"):PostAsync("https://discordapp.com/api/webhooks/"..self.id.."/"..self.key,data)
end

return webHook