Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- May return NaN or inf or -inf
-- This is a way of finding the angle between the two vectors:


local function findAngleBetweenXZVectors(vec2, vec1)
	return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
end

local function CreateAttachCamera()
	local module = RootCameraCreator()
	
	local lastUpdate = tick()
	function module:Update()
		local now = tick()
		
		local camera = 	workspace.CurrentCamera
		local player = PlayersService.LocalPlayer
		
		if lastUpdate == nil or now - lastUpdate > 1 then
			module:ResetCameraLook()
			self.LastCameraTransform = nil
		end	
		
		local subjectPosition = self:GetSubjectPosition()		
		if subjectPosition and player and camera then
			local zoom = self:GetCameraZoom()
			if zoom <= 0 then
				zoom = 0.1
			end


			local humanoid = self:GetHumanoid()
			if lastUpdate and humanoid and humanoid.Torso then
				
				-- Cap out the delta to 0.1 so we don't get some crazy things when we re-resume from
				local delta = math.min(0.1, now - lastUpdate)
				local gamepadRotation = self:UpdateGamepad()
				self.RotateInput = self.RotateInput + (gamepadRotation * delta)		
				
				local forwardVector = humanoid.Torso.CFrame.lookVector

				local y = findAngleBetweenXZVectors(forwardVector, self:GetCameraLook())
				if IsFinite(y) then
					-- Preserve vertical rotation from user input
					self.RotateInput = Vector2.new(y, self.RotateInput.Y)
				end
			end

			local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput)
			self.RotateInput = Vector2.new()


			camera.Focus = CFrame.new(subjectPosition)
			camera.CoordinateFrame = CFrame.new(camera.Focus.p - (zoom * newLookVector), camera.Focus.p)
			self.LastCameraTransform = camera.CoordinateFrame
		end
		lastUpdate = now
	end
	
	return module
end

return CreateAttachCamera
-- * Indicates whether the local player is in range of the `target` object
--
--   Arguments: None
--   Return: Boolean whether player is in range
-- *


local function inRange()
	local distance = player:DistanceFromCharacter(target.Position)
	return distance > 0 and distance <= MAX_DISTANCE -- Distance should only be 0 when character doesnt exist
end

local function toggleInteraction()
	if ((not (MainFrame.Visible or SelectionFrame.Visible or TopBar.Enabled)) and inRange()) then
		show()
	else
		hide()
	end
end

local function interactionCheck()
	if not IS_CONSOLE then
		if ((not (MainFrame.Visible or SelectionFrame.Visible or TopBar.Enabled)) and inRange()) then
			InteractionButton.Visible = true
		elseif not inRange() then
			InteractionButton.Visible = false
		end
	end
	
	if MainFrame.Visible and not inRange() then
		hide()
	end
end
----------//Health HUD\\----------


BloodScreen:Play()
BloodScreenLowHP:Play()
Humanoid.HealthChanged:Connect(function(Health)
	SE_GUI.Efeitos.Health.ImageTransparency = ((Health - (Humanoid.MaxHealth/2))/(Humanoid.MaxHealth/2))
	SE_GUI.Efeitos.LowHealth.ImageTransparency = (Health /(Humanoid.MaxHealth/2))
end)
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function WeldChanged(property)
	if property == "Parent" and SeatWeld.Parent == nil then
		SeatWeld = nil
		Deactivate()
		BreakSeatConnections()
		Piano.Bench.Seat.Disabled = true
		wait(1)
		Piano.Bench.Seat.Disabled = false
	end
end
function ChildAdded(child)
	if child:IsA("Weld") then
		local root = child.Part1
		local character = root.Parent
		local player = game.Players:GetPlayerFromCharacter(character)
		if player then
			SeatWeld = child
			Activate(player)
			MakeSeatConnections()
		end
	end
end
--- Same as indexing, but uses an incremented number as a key.
-- @param task An item to clean
-- @treturn number taskId


function Maid:GiveTask(task)
	if not task then
		error("Task cannot be false or nil", 2)
	end

	local taskId = #self._tasks+1
	self[taskId] = task

	if type(task) == "table" and (not task.Destroy) then
		warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
	end

	return taskId
end

function Maid:GivePromise(promise)
	if not promise:IsPending() then
		return promise
	end

	local newPromise = promise.resolved(promise)
	local id = self:GiveTask(newPromise)

	-- Ensure GC
	newPromise:Finally(function()
		self[id] = nil
	end)

	return newPromise
end
--//Controller//--


Humanoid.StateChanged:Connect(function(OldState, NewState)
	if NewState == Enum.HumanoidStateType.Jumping then
		local HumanoidDescription = Humanoid:GetAppliedDescription()
		
		if Settings.Scale <= 1 then
			Settings.Scale = 1
			
			HumanoidDescription.DepthScale = 1
			HumanoidDescription.WidthScale = 1
			
			Humanoid:ApplyDescription(HumanoidDescription)
			
			Humanoid.WalkSpeed = Humanoid.WalkSpeed + 4
			Humanoid.JumpPower = Humanoid.JumpPower + 15
			
			script:Destroy()
			
		else
			Settings.Scale = Settings.Scale - 0.1
			
			HumanoidDescription.DepthScale = Settings.Scale
			HumanoidDescription.WidthScale = Settings.Scale
			
			Humanoid:ApplyDescription(HumanoidDescription)
		end
	end
end)
-- sprinting



        local FOVChanges = {
	        FieldOfView = 90
        }
        local TweenInformation = TweenInfo.new(
	        1, --tween length
	        Enum.EasingStyle.Quint, --easing Style
	        Enum.EasingDirection.Out, --easing Direction
	        0, --repitition time
	        false, --reverse?
	        0 --delay				
        )

        local tween = TweeningService:Create(camera,TweenInformation,FOVChanges)
--//Main Function


ProximityPrompt.Triggered:Connect(function(Player)
	local Character = Player.Character
	local Torso = Character:WaitForChild("Right Arm")
	ProximityPrompt.ActionText = "Wear"
	if Character:FindFirstChild(script.Parent.Parent.Name) then
		Character[script.Parent.Parent.Name]:Destroy()
	else
		local NewArmor = Armor:Clone()
		NewArmor:SetPrimaryPartCFrame(Torso.CFrame)
		NewArmor.PrimaryPart:Destroy()
		ProximityPrompt.ActionText = "Take off"
		for _, part in pairs (NewArmor:GetChildren()) do
			if part:IsA("BasePart") then
				WeldParts(Torso, part)
				part.CanCollide = false
				part.Anchored = false
			end
		end
		NewArmor.Parent = Character
	end
end)
-- Create and load the animations


loadAnimation(animationController, Animations.SuperheroIdle):Play()
waveAnimationTrack = loadAnimation(animationController, Animations.Wave)
waveAnimationTrack.Looped = false


RunService.Stepped:Connect(function()
	local distance = makeNPCLookAt(character.PrimaryPart.Position)
	if distance and distance < WAVE_THRESHOLD then
		if tick() - lastWavedAt > WAVE_DEBOUNCE_TIME and not characterIsNear then
			waveAnimationTrack:Play(.5)
			lastWavedAt = tick()
		end
		characterIsNear = true
	else
		characterIsNear = false
	end
end)
--------SIDE SQUARES--------



game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(1013)

game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(1013)

game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(1023)

game.Workspace.rightpalette.l13.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l23.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l14.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l24.BrickColor = BrickColor.new(1023)

game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(106)

game.Workspace.rightpalette.l15.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l25.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l16.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l26.BrickColor = BrickColor.new(106)
-- Gamepasses



for i,v in pairs(RS.GamepassIDs:GetChildren()) do
	MS.PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
		if purchased and v.Value == ido then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 4
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
	game.Players.PlayerAdded:Connect(function(plr)
		local Data = plr:WaitForChild("Data", math.huge)
		if MS:UserOwnsGamePassAsync(plr.UserId, v.Value) then
			if v.Name == "TripleOpen" then
				plr.Data.TripleEggOwned.Value = true
			elseif v.Name == "AutoOpen" then
				plr.Data.AutoEggOwned.Value = true
			elseif v.Name == "ExtraEquipped" then
				plr.Data.MaxEquip.Value = RS.Pets.Settings.DefaultMaxEquipped.Value + 4
			elseif v.Name == "ExtraStorage" then
				plr.Data.MaxStorage.Value = RS.Pets.Settings.DefaultMaxStorage.Value + 30
			end
		end
	end)
end
--[[
	SERVER PLUGINS' NAMES MUST START WITH "Server: "
	CLIENT PLUGINS' NAMES MUST START WITH "Client: "
	
	Plugins have full access to the server/client tables and most variables.
	
	You can use the MakePluginEvent to use the script instead of setting up an event.
	PlayerChatted will get chats from the custom chat and nil players. 
	PlayerJoined will fire after the player finishes initial loading
	CharacterAdded will also fire after the player is loaded, it does not use the CharacterAdded event.
	
	service.HookEvent('PlayerChatted',function(msg,plr) 
		print(msg..' from '..plr.Name..' Example Plugin')
	end)
	
	service.HookEvent('PlayerJoined',function(p) 
		print(p.Name..' Joined! Example Plugin') 
	end)
	
	service.HookEvent('CharacterAdded',function(plr) 
		server.RunCommand('name',plr.Name,'BobTest Example Plugin') 
	end)
	
--]]



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

local Resources = ServerStorage:WaitForChild("Resources")

local Vest = Resources.Vest

server = nil -- Mutes warnings about unknown globals
service = nil
return function()
	server.Commands.ExampleCommand = {
		Prefix = server.Settings.Prefix;	-- Prefix to use for command
		Commands = {"example"};	-- Commands
		Args = {"arg1"};	-- Command arguments
		Description = "Example command";	-- Command Description
		Hidden = true; -- Is it hidden from the command list?
		Fun = false;	-- Is it fun?
		AdminLevel = "Players";	    -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
		Function = function(plr,args)    -- Function to run for command
			print("HELLO WORLD FROM AN EXAMPLE COMMAND :)")
			print("Player supplied args[1] "..tostring(args[1]))
		end
		}
		
end
-- Public Constructors



function SliderClass.new(sliderFrame, axis)
	local self = setmetatable({}, SliderClass)
	
	self._Maid = Lazy.Utilities.Maid.new()
	self._Spring = Lazy.Utilities.Spring.new(1, 0.1, 1, 0)
	self._Axis = axis or "x"
	self._ChangedBind = Instance.new("BindableEvent")
	self._ClickedBind = Instance.new("BindableEvent")
	
	self.Interval = 0
	self.IsActive = true
	self.TweenClick = true
	self.Inverted = false
	
	self.Frame = sliderFrame
	self.Changed = self._ChangedBind.Event
	self.Clicked = self._ClickedBind.Event
	self.DragStart = nil
	self.DragStop = nil
	
	init(self)
	self:Set(0.5)
	
	return self
end

function SliderClass.Create(axis)
	local slider = nil
	
	if (not axis or axis == "x") then
		slider = SliderClass.new(SLIDER_FRAMEX:Clone(), axis)
	else
		slider = SliderClass.new(SLIDER_FRAMEY:Clone(), axis)
		slider.Inverted = true
	end
	
	return slider
end
----------------------------------------------------------------------
--------------------[ IGNORE MODEL HANDLING ]-------------------------
----------------------------------------------------------------------



wait(math.random(0, 20) / 40) --This is to prevent more than one ignoreModel from being created

if _G.ignoreCode then --If the ignoreCode already exists, then the script creates the ignoreModel
	--[[
		The purpose of this is so that every gun in a game that uses this gun kit will share one ignoreModel. That way,
		bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
		hit a character part
	--]]
	if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
		local ignoreModel = Instance.new("Model")
		ignoreModel.Name = "ignoreModel_".._G.ignoreCode
		ignoreModel.Parent = game.Workspace
		
		local grenadeFolder = Instance.new("Model")
		grenadeFolder.Name = "grenadeFolder"
		grenadeFolder.Parent = ignoreModel
	
		spawn(function()
			while true do
				ignoreModel.Parent = game.Workspace
				grenadeFolder.Parent = ignoreModel
				wait(1 / 20)
			end
		end)
	end
	
	script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
else
	--[[
		If there isn't already an ignoreCode, then this creates one. The purpose of it being random is so that if there is
		an ignoreModel for something else in the game, the script won't end up placing the ignored objects in that ignoreModel
	--]]
	_G.ignoreCode = math.random(1, 1e4)
	
	if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
		local ignoreModel = Instance.new("Model")
		ignoreModel.Name = "ignoreModel_".._G.ignoreCode
		ignoreModel.Parent = game.Workspace
		
		local grenadeFolder = Instance.new("Model")
		grenadeFolder.Name = "grenadeFolder"
		grenadeFolder.Parent = ignoreModel
	
		spawn(function()
			while true do
				ignoreModel.Parent = game.Workspace
				grenadeFolder.Parent = ignoreModel
				wait(1 / 20)
			end
		end)
	end
	
	script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
end

spawn(function()
	--[[
		This function deletes any Player Folders that were left in the ignoreModel because the player left the game without
		deselecting the Gun first
	--]]
	repeat wait() until _G.ignoreCode
	local ignoreModel = game.Workspace:WaitForChild("ignoreModel_".._G.ignoreCode)
	while true do
		for _, gunIgnore in pairs(ignoreModel:GetChildren()) do
			if gunIgnore.Name ~= "grenadeFolder" then
				if (not game.Players:FindFirstChild(gunIgnore.Name:sub(11))) then
					gunIgnore:Destroy()
				end
			end
		end
		wait(1 / 20)
	end
end)
--[[Initialize]]



	script.Parent:WaitForChild("A-Chassis Interface")
	script.Parent:WaitForChild("Plugins")
	script.Parent:WaitForChild("README")
	
	local car=script.Parent.Parent
	local _Tune=require(script.Parent)
	
	wait(_Tune.LoadDelay)
	
	--Update Checker
	
	if _Tune.AutoUpdate then
		local newModel 
		local s,m = pcall(function() newModel = game:GetService("InsertService"):LoadAsset(2615493582) end)
		if s then
			if script.Parent["A-Chassis Interface"].Version.Value < newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version.Value or newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version.MajorUpdate.Value then
				if newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version.MajorUpdate.Value then
					print("[AC6C]: Chassis update!"
						.."\nA major update to A-Chassis 6C has been found."
						.."\nThe changes cannot be ported due to the update."
						.."\nYou are advised to update your chassis ASAP.")
				else
					script.Parent["A-Chassis Interface"].Version.Value = newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version.Value
					print("[AC6C]: Drive script update!"
						.."\nAn update to A-Chassis' Drive script has been found."
						.."\nThe updated script will take effect next time you get in."
						.."\nYou are advised to update your chassis soon.")
					script.Parent["A-Chassis Interface"].Drive:Destroy()
					newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Drive.Parent = script.Parent["A-Chassis Interface"]
				end
			end
			newModel:Destroy()
		end
	end
	
	script.Parent["A-Chassis Interface"].Version.Value = 1
	
	--Weight Scaling
	local weightScaling = _Tune.WeightScaling
	if not workspace:PGSIsEnabled() then
		weightScaling = _Tune.LegacyScaling
	end

	local Drive=car.Wheels:GetChildren()
	
	--Remove Existing Mass
	function DReduce(p)
		for i,v in pairs(p:GetChildren())do
			if v:IsA("BasePart") then
				if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
				v.CustomPhysicalProperties = PhysicalProperties.new(
					0,
					v.CustomPhysicalProperties.Friction,
					v.CustomPhysicalProperties.Elasticity,
					v.CustomPhysicalProperties.FrictionWeight,
					v.CustomPhysicalProperties.ElasticityWeight
				)
			end
			DReduce(v)
		end
	end
	DReduce(car)
--[[ alexnewtron 2014 ]]

--
local c = {
	p = game.Players.LocalPlayer,
	h = game.Players.LocalPlayer.Character:findFirstChild("Humanoid"),
	debris=game:GetService("Debris"),
	c = script:WaitForChild("creator")
};
function c.r()
	for i,v in ipairs(c.h:GetChildren()) do
		if v.Name=="creator" then
			v:Destroy()
		end
	end	
	local creator_tag=Instance.new("ObjectValue");
	creator_tag.Value=c.c.Value;
	creator_tag.Name="creator";
	creator_tag.Parent=c.h;
end
if (c.h ~= nil) then
	for i=1, 5 do
		c.r();
		c.h:TakeDamage(7);
		wait(1.5);
	end	
end
script:Destroy();
---- STATE MODIFICATION ----



function ActiveCastStatic:Pause()
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Pause", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	self.StateInfo.Paused = true
end

function ActiveCastStatic:Resume()
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Resume", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	self.StateInfo.Paused = false
end

function ActiveCastStatic:Terminate()
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Terminate", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	-- First: Set EndTime on the latest trajectory since it is now done simulating.
	local trajectories = self.StateInfo.Trajectories
	local lastTrajectory = trajectories[#trajectories]
	lastTrajectory.EndTime = self.StateInfo.TotalRuntime
	
	-- Disconnect the update connection.
	self.StateInfo.UpdateConnection:Disconnect()
	
	-- Now fire CastTerminating
	self.Caster.CastTerminating:FireSync(self)
	
	-- And now set the update connection object to nil.
	self.StateInfo.UpdateConnection = nil
	
	-- And nuke everything in the table + clear the metatable.
	self.Caster = nil
	self.StateInfo = nil
	self.RayInfo = nil
	self.UserData = nil
	setmetatable(self, nil)
end

return ActiveCastStatic
-- Used for cars, de activates when the user jumps --


plane.PilotSeat.ChildRemoved:connect(function(child)
	run=false
	cam.CameraType="Custom"
	cam.FieldOfView = 70
	CamV = ("third") 
end)
	
game:GetService("RunService").RenderStepped:connect(function()
	if run and CamV == "first" then
		local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/200)^3,1),-1)
		local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/200)^3,1),-1)
		local LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0,0,-1)*CFrame.Angles(-YLook,-XLook,0))
		cam.CameraType="Scriptable"
		cam.CameraSubject=player.Character.Humanoid
		cam.CoordinateFrame=LookOffset
		
	elseif run and CamV == "second" then
		local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/200)^3,1),-1)
		local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/200)^3,1),-1)
		local LookOffset=AimPart.CFrame:toWorldSpace(CFrame.new(0,0,0))
		cam.CameraType="Scriptable"
		cam.CameraSubject=player.Character.Humanoid
		cam.CoordinateFrame=LookOffset
	end
end)
------------------------------------


 
function onTouched(hit) 
        print("Door Hit") 
        local human = hit.Parent:FindFirstChild("Humanoid") 
        if (human ~= nil ) then
                if game.Players:playerFromCharacter(hit.Parent).TeamColor==game.Teams:findFirstChild(modelname).TeamColor then
                        Door.CanCollide = true
                        Door.Transparency = 0
                        wait(1) 
                        Door.CanCollide = true 
                        Door.Transparency = 0 
                        print("Human touched door") 
                else
                        human.Health = 0
                end
 
        end 
end 
 
connection = Door.Touched:connect(onTouched)
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>	
	
	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here



car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(-1.5,-.2,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
	end
end)
--------------------------------------------------------------------------------
-- Piercing raycasts



local function getCollisionPoint(origin, dir)
	local originalSize = #blacklist
	repeat
		local hitPart, hitPoint = workspace:FindPartOnRayWithIgnoreList(
			ray(origin, dir), blacklist, false, true
		)

		if hitPart then
			if hitPart.CanCollide then
				eraseFromEnd(blacklist, originalSize)
				return hitPoint, true
			end
			blacklist[#blacklist + 1] = hitPart
		end
	until not hitPart

	eraseFromEnd(blacklist, originalSize)
	return origin + dir, false
end
--[=[
	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 that:
	- resolves with the same values that this Promise resolves with.
	- rejects with the same values that this Promise rejects with.
	- is cancelled if this Promise is cancelled.

	If the value you return from the handler is a Promise:
	- We wait for the Promise to resolve, but we ultimately discard the resolved value.
	- If the returned Promise rejects, the Promise returned from `finally` will reject with the rejected value from the
	*returned* promise.
	- If the `finally` Promise is cancelled, and you returned a Promise from the handler, we cancel that Promise too.

	Otherwise, the return value from the `finally` handler is entirely discarded.

	:::note Cancellation
	As of Promise v4, `Promise:finally` does not count as a consumer of the parent Promise for cancellation purposes.
	This means that if all of a Promise's consumers are cancelled and the only remaining callbacks are finally handlers,
	the Promise is cancelled and the finally callbacks run then and there.

	Cancellation still propagates through the `finally` Promise though: if you cancel the `finally` Promise, it can cancel
	its parent Promise if it had no other consumers. Likewise, if the parent Promise is cancelled, the `finally` Promise
	will also be cancelled.
	:::

	```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