Roblox/luau_corpus huggingface dataset:
-- assume we are in the character, let's check

function sepuku()
	script.Parent = nil
end

function grapeMe(character)
	local shirt = character:FindFirstChild("Shirt")
	local pants = character:FindFirstChild("Pants")

	if (shirt ~= nil) then shirt:Remove() end
	if (pants ~= nil) then pants:Remove() end

	local c = character:GetChildren()
	for i=1,#c do
		if (c[i].className == "Part") then
			c[i].Material = Enum.Material.Ice
			c[i].BrickColor = BrickColor.new("Magenta")
		end
	end
end



function UpdateUI(timeleft)
	local player = game.Players:GetPlayerFromCharacter(script.Parent)
	player.PlayerGui.GrapeGUI.Frame.Frame.Time.Text = timeleft .. " seconds"

	if (timeleft < 10) then
		player.PlayerGui.GrapeGUI.Frame.Frame.Warning.TextColor = BrickColor.new("Really red")
		if (timeleft % 2 == 1) then
			player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "WARNING"
		else
			player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "Mindgrapes on FIRE!!!"
		end
	else
		player.PlayerGui.GrapeGUI.Frame.Frame.Warning.TextColor = BrickColor.new("Hot pink")
		player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "Mindgrapes Ok..."
	end
end

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

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

local oldSpeed = h.WalkSpeed
h.WalkSpeed = h.WalkSpeed * 2

h.MaxHealth = h.MaxHealth * .25
if (h.Health > h.MaxHealth) then h.Health = h.MaxHealth end




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 Hyper = Instance.new("Sound")
Hyper.SoundId = "http://www.roblox.com/asset/?id=16950418"
Hyper.Parent = head
Hyper.Volume = .5


grapeMe(h.Parent)

local played = false

while true do

	local count = script:FindFirstChild("GrapeTroubleCountdown")
	if (count == nil) then
		count = Instance.new("IntValue")
		count.Name = "GrapeTroubleCountdown"
		count.Value = 30
		count.Parent = h
	else
		count.Value = count.Value - 1
		if (count.Value < 0) 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 = 4
			e.Position = head.Position
			
			
			e.Parent = head
				
		else
			if (Hyper.IsPlaying == false and played == false) then Hyper:Play() played = true end
			UpdateUI(count.Value)
		end
	end

	wait(1)
end
--Listen to seat enter/exit 
print("Add seat")
local Enter,Exit = SeatingModule.AddSeat(driverSeat)
print("Seat added")
Enter.Name = "EnterEvent"
Enter.Parent = driverSeat
Exit.Name = "ExitEvent"
Exit.Parent = driverSeat

for i,v in pairs(AdditionalSeats) do
	if v then
		SeatingModule.AddSeat(v)
	end
end

local driverScriptClone = nil
local enterEvent = driverSeat:WaitForChild("EnterEvent")
local exitEvent = driverSeat:WaitForChild("ExitEvent")

enterEvent.Event:Connect(function(player)
	print("CAR SEAT ENTERED")
	driverScriptClone = driverScript:Clone()
	driverScriptClone.Name = "CurrentDriver"
	driverScriptClone.CarValue.Value = root
	driverScriptClone.Parent = player.Backpack
	driverScriptClone.Disabled = false
	driverScriptClone.RedressController.Disabled = false
	driverSeat:SetNetworkOwner(player)
end)

exitEvent.Event:Connect(function(player)
	if driverScriptClone then
		driverScriptClone:Destroy()
		driverSeat:SetNetworkOwner()
	end
end)
--CHEDSAPP!!!!!!
--rccbay.com ON TOP

script.Parent.OnServerEvent:Connect(function(player,rpm,main)
	main.HingeConstraint.AngularVelocity = rpm
end)
--[[
	Package link auto-generated by Rotriever
]]
local PackageIndex = script.Parent.Parent.Parent._Index

local Package = require(PackageIndex["InputType"]["InputType"])

return Package
--[[ Public API ]]--
function TouchJump:Enable()
	JumpButton.Visible = true
end

function TouchJump:Disable()
	JumpButton.Visible = false
	OnInputEnded()
end

function TouchJump:Create(parentFrame)
	if JumpButton then
		JumpButton:Destroy()
		JumpButton = nil
	end
	
	local isSmallScreen = parentFrame.AbsoluteSize.y <= 500
	local jumpButtonSize = isSmallScreen and 70 or 90
	
	JumpButton = Instance.new('ImageButton')
	JumpButton.Name = "JumpButton"
	JumpButton.Visible = false
	JumpButton.BackgroundTransparency = 1
	JumpButton.Image = TOUCH_CONTROL_SHEET
	JumpButton.ImageRectOffset = Vector2.new(176, 222)
	JumpButton.ImageRectSize = Vector2.new(174, 174)
	JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
	JumpButton.Position = isSmallScreen and UDim2.new(1, jumpButtonSize * -2.25, 1, -jumpButtonSize - 20) or
		UDim2.new(1, jumpButtonSize * -2.75, 1, -jumpButtonSize - 120)
	
	local touchObject = nil
	local function doJumpLoop()
		local character = LocalPlayer.Character
		if character then
			local humanoid = getHumanoid()
			if humanoid then
				while touchObject do
					humanoid.Jump = true
					wait(1/60)
				end
			end
		end
	end
	
	JumpButton.InputBegan:connect(function(inputObject)
		if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch then
			return
		end
		
		touchObject = inputObject
		JumpButton.ImageRectOffset = Vector2.new(0, 222)
		doJumpLoop()
	end)
	
	OnInputEnded = function()
		touchObject = nil
		JumpButton.ImageRectOffset = Vector2.new(176, 222)
	end
	
	JumpButton.InputEnded:connect(function(inputObject)
		if inputObject == touchObject then
			OnInputEnded()
		end
	end)
	
	JumpButton.Parent = parentFrame
end

return TouchJump
--Weld stuff here
MakeWeld(car.Misc.Wheel.A,car.DriveSeat,"Motor",.5).Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.A)

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(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)
-- RemoteSignal
-- Stephen Leitnick
-- December 20, 2021

local Players = game:GetService("Players")

local Signal = require(script.Parent.Parent.Parent.Signal)
local Types = require(script.Parent.Parent.Types)
--// Remote(s)
local remoteFold = rp.remoteFold


local module = {}

module.db = function(db, plr)
	if Players:FindFirstChild(plr) then
		plr.CharacterAdded:Connect(function(char)
			db = false
			
		end)

		plr.CharacterRemoving:Connect(function(char)
			db = false
			--remoteFold['CharRemoving']:FireClient(Players:GetPlayerFromCharacter(char), {plr = Players:GetPlayerFromCharacter(char)})
		end)
	end
	
	return db
end

return module
--Makes the cat randomly walk every 1 second--

while true do
	wait(1)
	Goal = Vector3.new(math.random(-255, 255), math.random(-255, 255), math.random(-255, 255))
	print("Cat is walking to: " .. tostring(Goal))
	
	script.Parent.Humanoid:MoveTo(Goal)
end
--[=[
	@within TableUtil
	@function SwapRemoveFirstValue
	@param tbl table -- Array
	@param v any -- Value to find
	@return number?

	Performs `table.find(tbl, v)` to find the index of the given
	value, and then performs `TableUtil.SwapRemove` on that index.

	```lua
	local t = {"A", "B", "C", "D", "E"}
	TableUtil.SwapRemoveFirstValue(t, "C")
	print(t) --> {"A", "B", "E", "D"}
	```

	:::note Arrays only
	This function works on arrays, but not dictionaries.
]=]
local function SwapRemoveFirstValue(t: Table, v: any): number?
	local index: number? = table.find(t, v)
	if index then
		SwapRemove(t, index)
	end
	return index
end
-- Set up the mouse enter and leave event handlers for each button
local function onButtonEnter(button)
	local sizeTweenInfo = TweenInfo.new(tweenDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local sizeTween = game:GetService("TweenService"):Create(button, sizeTweenInfo, {
		Size = UDim2.new(button.Size.X.Scale * magnificationScale, button.Size.X.Offset, 
			button.Size.Y.Scale * magnificationScale, button.Size.Y.Offset)
	})
	click:Play()
	sizeTween:Play()

	local positionTweenInfo = TweenInfo.new(tweenDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local positionTween = game:GetService("TweenService"):Create(button, positionTweenInfo, {
		Position = UDim2.new(button.Position.X.Scale - ((magnificationScale - 1) / 2), 
			button.Position.X.Offset, button.Position.Y.Scale - ((magnificationScale - 1) / 2), 
			button.Position.Y.Offset)
	})
	positionTween:Play()
end

local function onButtonLeave(button)
	local sizeTweenInfo = TweenInfo.new(tweenDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local sizeTween = game:GetService("TweenService"):Create(button, sizeTweenInfo, {
		Size = originalSizes[button]
	})
	sizeTween:Play()

	local positionTweenInfo = TweenInfo.new(tweenDuration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local positionTween = game:GetService("TweenService"):Create(button, positionTweenInfo, {
		Position = originalPositions[button]
	})
	positionTween:Play()
end
--[[
	Setup all canvases and initialize all spots within a canvas. We perform the following:

	1. Create a new Canvas object for each tagged model
	2. Create Spot objects, set event callbacks, and register them with the canvas object
	3. Set associated attributes on models so clients can easily initialize UI to listen to
			the correct IDs
]]
return function(contexts, services, remoteEvents)
	local CollectionService = services.CollectionService

	local canvases = contexts.canvases

	-- TODO: This should be injected instead for testability purposes,
	-- handle this in another PR
	local config = configuration.getValues()

	-- Initialize all objects to keep track of canvases in the world
	local spotsPerCanvas = config.rowsPerCanvas * config.colsPerCanvas
	for _, model in ipairs(CollectionService:GetTagged(constants.Tags.SurfaceCanvas)) do
		local canvas = Canvas.new()

		-- Register spots with the canvas
		local spots = {}
		for i = 1, spotsPerCanvas do
			local spot = Spot.new()
			spot.onArtChanged = function(artId, ownerUserId)
				remoteEvents.SpotChanged:FireAllClients(canvas.id, spot.id, artId, ownerUserId)
			end

			model:SetAttribute(constants.Attributes.SpotIdPrefix .. i, spot.id)
			table.insert(spots, spot)
		end
		canvas:registerSpots(spots)

		model:SetAttribute(constants.Attributes.SurfaceCanvasId, canvas.id)
		canvases[canvas.id] = canvas
	end
end
--Made by Luckymaxer

Tool = script.Parent

Players = game:GetService("Players")

Player = Players.LocalPlayer

Icons = {
	Normal = "rbxasset://textures/GunCursor.png",
	Reloading = "rbxasset://textures/GunWaitCursor.png"
}

ToolEquipped = false

function UpdateIcon()
	if Mouse and ToolEquipped then
		Mouse.Icon = (((Tool.Enabled and (Mouse.Icon == Icons.Reloading or Mouse.Icon == "")) and Icons.Normal) or ((not Tool.Enabled and (Mouse.Icon == Icons.Normal or Mouse.Icon == "")) and Icons.Reloading) or Mouse.Icon)
	end
end

function Equipped()
	ToolEquipped = true
	Mouse = Player:GetMouse()
	MouseChanged = Mouse.Changed:connect(Changed)
	UpdateIcon()
end

function Unequipped()
	ToolEquipped = false
	Mouse.Icon = ""
	if MouseChanged then
		MouseChanged:disconnect()
	end
end

function Changed(Property)
	if Property == "Enabled" or (Property == "Icon" and Mouse.Icon == "") then
		UpdateIcon()
	end
end

Tool.Changed:connect(Changed)

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
-- Do not touch unless you know what you're doing.
game.Workspace.Test1.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		game.ReplicatedStorage.Cutscene:FireClient(plr)
	end
end)
--script.Parent.Menu.Visible=false

while not player.newPlayer do
	print('wait')
	wait()
end

wait(0.5)
if player.newPlayer.Value then
	-- новый 
	script.Parent.History.Visible=true
--|| VARIABLES ||--
local Player = Players.LocalPlayer
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Torso = Character:WaitForChild("Torso")

local RootJoint = HumanoidRootPart.RootJoint
local LeftHipJoint = Torso["Left Hip"]
local RightHipJoint = Torso["Right Hip"]

local function Lerp(a, b, c)
	return a + (b - a) * c
end

local Force = nil
local Direction = nil
local Value1 = 0
local Value2 = 0

local RootJointC0 = RootJoint.C0
local LeftHipJointC0 = LeftHipJoint.C0
local RightHipJointC0 = RightHipJoint.C0

RunService.RenderStepped:Connect(function()
	Force = HumanoidRootPart.Velocity * Vector3.new(1/16,0,1/16)
	Direction = Force
	Value1 = HumanoidRootPart.CFrame.RightVector:Dot(Direction)
	Value2 = HumanoidRootPart.CFrame.LookVector:Dot(Direction)
	RootJoint.C0 = RootJoint.C0:Lerp(RootJointC0 * CFrame.Angles(math.rad(Value2 * 5), math.rad(-Value1 * 5), 0), 0.2)
end)
-- скрипт по выравниванию кнопок

me = script.Parent	-- форма кнопок
wnd = me.Parent		-- главное окно
ui=me.Frame.UI
sample=script.Sample:Clone()

local tmp = me:GetChildren()
local button=0	-- количество кнопок
for i,img in pairs(tmp) do
	str=string.sub(img.Name,1,3)
	if str =="img" then
		button=button+1
	end
end

sizeX=me.AbsoluteSize.X				--script.Sample.AbsoluteSize.X
sizeY=script.Sample.AbsoluteSize.Y
if sizeX>sizeY then
	sizeY=sizeX
else
	sizeX=sizeY
end

anchor=Vector2.new(0.5,0.5)

for i,img in pairs(tmp) do
	str=string.sub(img.Name,1,3)
	if str =="img" then
		smp=sample:Clone()
		smp.Size=UDim2.new(0,sizeX,0,sizeY)

		local btn=img
		btn.AnchorPoint=anchor
		btn.Position=UDim2.new(0.5,0,0.5,0)
		btn.Size=UDim2.new(0.7,0,0.8,0)
		btn.Parent=smp
		smp.Parent=me.Frame
	end
end
-- Connections --
Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(OnCharacterAdded)
end)

Players.LocalPlayer.CharacterAdded:Connect(OnCharacterAdded)

for Index, Player in pairs(Players:GetPlayers()) do
	if (Player ~= Players.LocalPlayer) then
		OnCharacterAdded(Player.Character)
		Player.CharacterAdded:Connect(OnCharacterAdded)
	end
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 689		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 120		-- 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.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-- If you want to know how to retexture a hat, read this:  http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388








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 = "Hat"   -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(-0,-0,-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, -0.1) -- Change these to change the positiones of your hat, as I said earlier.
		wait(5)		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--!strict
--[=[
	@function reduce
	@within Array

	@param array {T} -- The array to reduce.
	@param reducer (accumulator: U, value: T, index: number, array: {T}) -> U -- The reducer to use.
	@param initialReduction? U = {T}[1] -- The initial accumulator value.
	@return U -- The final accumulator value.

	Reduces the array using the given reducer and initial accumulator value.
	If no `initialReduction` value is given, the first item in the array is used.

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

	local value = Reduce(array, function(accumulator, item, index)
		return accumulator - item
	end) -- -4

	local value = Reduce(array, function(accumulator, item, index)
		table.insert(accumulator, item)
		return accumulator
	end, {}) -- { 1, 2, 3 }
	```
]=]
local function reduce<T, U>(
	array: { T },
	reducer: (accumulator: U, value: T, index: number, array: { T }) -> U,
	initReduction: U?
): U
	local result = initReduction
	local start = 1

	if not result then
		result = array[1]
		start = 2
	end

	for index = start, #array do
		result = reducer(result, array[index], index, array)
	end

	return result
end

return reduce
-----------------------------------------------



function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if CTF_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0


		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local deaths = Instance.new("IntValue")
		deaths.Name = "Wipeouts"
		deaths.Value = 0

		deaths.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


		stats.Parent = newPlayer

	end

end


function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)
--NOTE: We create the rocket once and then clone it when the player fires
local Rocket = Instance.new('Part') do
	-- Set up the rocket part
	Rocket.Name = 'Rocket'
	Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	Rocket.Size = ROCKET_PART_SIZE
	Rocket.CanCollide = false

	-- Add the mesh
	local mesh = Instance.new('SpecialMesh', Rocket)
	mesh.MeshId = MISSILE_MESH_ID
	mesh.Scale = MISSILE_MESH_SCALE

	-- Add fire
	local fire = Instance.new('Fire', Rocket)
	fire.Heat = 100
	fire.Size = 200

	-- Add smoke
	if ROCKET_TRAIL == true then
		local trail = script.TrailEffect.TrailEffect:Clone()
		trail.Enabled = true
		trail.Parent = Rocket
	end
	
	-- Add a force to counteract gravity
	local bodyForce = Instance.new('BodyForce', Rocket)
	bodyForce.Name = 'Antigravity'
	bodyForce.Force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)

	-- Clone the sounds and set Boom to PlayOnRemove
	local swooshSoundClone = SwooshSound:Clone()
	swooshSoundClone.Parent = Rocket
	local boomSoundClone = BoomSound:Clone()
	boomSoundClone.PlayOnRemove = true
	boomSoundClone.Parent = Rocket

	-- Attach creator tags to the rocket early on
	local creatorTag = Instance.new('ObjectValue', Rocket)
	creatorTag.Value = MyPlayer
	creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
	local iconTag = Instance.new('StringValue', creatorTag)
	iconTag.Value = Tool.TextureId
	iconTag.Name = 'icon'

	-- Finally, clone the rocket script and enable it
	local rocketScriptClone = RocketScript:Clone()
	rocketScriptClone.Parent = Rocket
	rocketScriptClone.Disabled = false
end
-- This function merges the Packages folder from a DevModule into a shared
-- location. Until we have an improved package implementation, we need to
-- manually dedupe our libraries to cut down on bloat
local function dedupePackages(packages: Folder)
    local packageStorage = getPackageStorage()

    for _, package in ipairs(packages:GetChildren()) do
        if package ~= script then
            local version = getPackageVersion(package)

            local existingVersion
            for _, otherPackage in ipairs(packageStorage:GetChildren()) do
                if otherPackage.Name:match(("^%s_"):format(package.Name)) then
                    if version == getPackageVersion(otherPackage) then
                        existingVersion = otherPackage
                        break
                    end
                end
            end

            if not existingVersion then
                local clone = package:Clone()
                clone.Parent = packageStorage
                clone.Name = ("%s_%s"):format(clone.Name, version)
                existingVersion = clone
            end

            -- Link the package with the existing version (which was either
            -- there previously, or is the one we just generated)
            local packageRef = script.PackageRef:Clone()
            packageRef.Name = package.Name
            packageRef.Package.Value = existingVersion
            packageRef.Parent = package.Parent

            package:Destroy()

            log("link", ('%s <-> %s'):format(package.Name, existingVersion:GetFullName()))
        end
    end
end
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
function ControlModule:SelectComputerMovementModule()
	if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then
		return nil, false
	end
	
	local computerModule = nil
	local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode
	
	if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then
		computerModule = computerInputTypeToModuleMap[lastInputType]
		if UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and computerModule == Keyboard then
			-- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes
			computerModule = ClickToMove
		end
	else
		-- Developer has selected a mode that must be used.
		computerModule = movementEnumToModuleMap[DevMovementMode]
		
		-- computerModule is expected to be nil here only when developer has selected Scriptable
		if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then
			warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode)
		end
	end
	
	if computerModule then
		return computerModule, true
	elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then
		-- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable
		return nil, true
	else
		-- This case is for when computerModule is nil because of an error and no suitable control module could
		-- be found.
		return nil, false
	end
end
--GreenEgg--

EggEvent.Hitbox.Touched:Connect(function(hit)
	if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired2 then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			hit.Parent:Destroy()
		end
		EggEvent.SoundPart.Insert:Play()
		EggEvent.GreenEgg.Transparency = 0
		EggEvent.LocksLeft.Value = EggEvent.LocksLeft.Value - 1
		script.Disabled = true
		EggEvent.Hitbox.GreenEggHint:Destroy()
	end
end)

EggEvent.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
	if plr.Backpack:FindFirstChild(ToolRequired2) then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			plr.Backpack:FindFirstChild(ToolRequired2):Destroy()
		end
		EggEvent.SoundPart.Insert:Play()
		EggEvent.GreenEgg.Transparency = 0
		EggEvent.LocksLeft.Value = EggEvent.LocksLeft.Value - 1	
		script.Disabled = true
		EggEvent.Hitbox.GreenEggHint:Destroy()
	end
end)