Roblox/luau_corpus huggingface dataset:
--------------------------------------------------------------------
if horn == true then
	mouse.KeyDown:connect(function(key)
		if key == camkey and enabled == false then

			local seat = car.DriveSeat
			local effect = script.soundeffect:Clone()
				effect.Name = "soundeffectCop"
			effect.Parent = seat.Horn

		elseif key == camkey and enabled == true then

			local seat = car.DriveSeat
			seat.Horn.soundeffectCop:Destroy()
			
		end
		car.DriveSeat.ChildRemoved:Connect(function(child)

			if child.Name == "SeatWeld" then
				local seat = car.DriveSeat
				seat.Horn.soundeffectCop:Destroy()
			end
		end)
	end)
end
--this function runs when players join your game
game.Players.PlayerAdded:Connect(function(player)
	DataManger.AddPlayerData(player)
	--this function runs when your player is added to the world, it also runs again when you reset
	player.CharacterAdded:Connect(function(char)
		
		--this is called the player humanoid, it handles a lot of things like animations, jumping, walkspeed
		local humanoid = char:WaitForChild("Humanoid")
		
		
		--this is setting your jump power to 0, too disable player jumping!
		humanoid.JumpPower = 0
		humanoid.JumpHeight = 0
		
		--this is handling for teleporting players to the checkPoints :)
		if player.Data.spawnpoint.Value ~= "" then
			local rootPart = char:WaitForChild("HumanoidRootPart")
			
			local foundCheckpoint = workspace.Interactions.Checkpoints:FindFirstChild(player.Data.spawnpoint.Value)
			
			if foundCheckpoint then
				task.wait(.5)
				
				rootPart.CFrame = (foundCheckpoint.Root.CFrame * CFrame.new(0,3,0))
			else
				warn("NO CHECKPOINT FOUND WITH THE NAME: "..player.Data.spawnpoint.Value.." DID YOU SET UP A CHECKPOINT WITH THAT NAME?")
			end
			
		end
		
	end)
end)

game.Players.PlayerRemoving:Connect(DataManger.RemovePlayerData)
--EDIT BELOW----------------------------------------------------------------------
settings.PianoSoundRange = 50

settings.KeyAesthetics = true

settings.PianoSounds = {
    "233836579",
    "233844049",
    "233845680",
    "233852841",
    "233854135",
    "233856105"
}
--------AUDIENCE BACK LEFT--------

game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(106)
game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(1013)
game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(1023)
game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(1023)
--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time

local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]

function HighlightPianoKey(note1,transpose)
	if not Settings.KeyAesthetics then return end
	local octave = math.ceil(note1/12)
	local note2 = (note1 - 1)%12 + 1
	local key = Piano.Keys.Keys:FindFirstChild(note1)
	local emitter = Piano.Case.ParticleEmitters:FindFirstChild(note1)
	if key and emitter then
		local obj = key
		local Properties = {}
		emitter.ParticleEmitter:Emit(1)
		if IsBlack(note1) then
			key.Material = "Neon"
			Properties.Color = Color3.fromRGB(70, 158, 44)
			Tween(obj,Properties,.15,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
			key.Material = "Neon"		
		else
			key.Material = "Neon"
			Properties.Color = Color3.fromRGB(106, 255, 106)
			Tween(obj,Properties,.15,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
			key.Material = "Neon"
		end
		Properties = {}
		Properties.Color = Color3.fromRGB(130, 130, 130)
		Tween(obj,Properties,.05,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
		key.Material = "SmoothPlastic"
	else
		print(note1..' was not found as either a key or emitter or both')
	end
	return
end
--[[Weight and CG]]
	Tune.Weight			= 250		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 1		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .9		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
---Creator function return object keys
local KEY_BASE_FRAME = "BaseFrame"
local KEY_BASE_MESSAGE = "BaseMessage"
local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction"
local KEY_GET_HEIGHT = "GetHeightFunction"
local KEY_FADE_IN = "FadeInFunction"
local KEY_FADE_OUT = "FadeOutFunction"
local KEY_UPDATE_ANIMATION = "UpdateAnimFunction"

local TextService = game:GetService("TextService")

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
	Players.ChildAdded:wait()
	LocalPlayer = Players.LocalPlayer
end

local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))

local okShouldClipInGameChat, valueShouldClipInGameChat = pcall(function() return UserSettings():IsUserFeatureEnabled("UserShouldClipInGameChat") end)
local shouldClipInGameChat = okShouldClipInGameChat and valueShouldClipInGameChat

local module = {}
local methods = {}
methods.__index = methods

function methods:GetStringTextBounds(text, font, textSize, sizeBounds)
	sizeBounds = sizeBounds or Vector2.new(10000, 10000)
	return TextService:GetTextSize(text, textSize, font, sizeBounds)
end
--Script:

Button.Activated:Connect(function()
	if MarketplaceService:UserOwnsGamePassAsync(PlayerId, Gamepass.Value) then 
		--FireMessage
		Message.Properties.Type.ItemAlreadyOwn.Value = true
		Message.Properties.FireMessage.Value = true
	else
		if GamepassInfo["IsForSale"] == true then
			MarketplaceService:PromptProductPurchase(Player, Gamepass.Value)
		else
			Message.Properties.Type.NotForSale.Value = true
			Message.Properties.FireMessage.Value = true			
		end
		
	end
end)
--OptionsManager
local OptionsFrame = Frames.OptionsFrame
local FrameBase = OptionsFrame.BaseFrame
local OptionsFrames = OptionsFrame.Frames
local OptionFrameName = nil
local OptionFrameToOpen = nil
local OptionFrameIsOpened = false
local OptionDebounce = false

local function OptionOpenGUI()
	for i = 1,0.6,-0.025 do
		OptionFrameToOpen.Visible = true
		OptionFrameToOpen.BackgroundTransparency = i
		Frames.Back.Transparency = i
		print(i)
		OptionFrameToOpen = true
		OptionDebounce = true
		task.wait()
	end
end

local function OptionCloseGUI()
	for i = 0.6,1,0.025 do
		OptionFrameToOpen.BackgroundTransparency = i
		Frames.Back.Transparency = i
		print(i)
		task.wait()
	end
	OptionFrameToOpen.Visible = false
	OptionFrameIsOpened = false
	task.wait(0.4)
	OptionDebounce = false
end

for _, OptionButton in pairs(Buttonsframe:GetDescendants()) do
	if OptionButton:IsA("TextButton") then
		OptionButton.MouseButton1Click:Connect(function()
			OptionFrameName = OptionButton.Name.."Frame"
			OptionFrameToOpen = OptionsFrames:FindFirstChild(OptionFrameName)
			if not OptionFrameToOpen.Visible then
				if not OptionFrameIsOpened and not OptionDebounce then
					for _, OptionButtons in pairs(FrameBase:GetDescendants()) do
						if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then
							OptionButtons.BackgroundTransparency = 0.95
							OptionButtons.Selectable = false
							OptionButton.BackgroundTransparency = 0.5
						end
					end
					OptionOpenGUI()
				end
			else
				for _, OptionButtons in pairs(FrameBase:GetDescendants()) do
					if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then
						OptionButtons.BackgroundTransparency = 0.6
						OptionButtons.Selectable = true
						OptionButton.BackgroundTransparency = 0.6
					end
				end
				OptionCloseGUI()
			end
		end)
	end
end
--[=[
	An already dead brio which may be used for identity purposes.

	```lua
	print(Brio.DEAD:IsDead()) --> true
	```

	@prop DEAD Brio
	@within Brio
]=]
Brio.DEAD = Brio.new()
Brio.DEAD:Kill()

return Brio
--Turbo Gauge GUI--

local fix = 0


script.Parent.Parent.Values.RPM.Changed:connect(function()
	
	script.Parent.BAnalog.Visible = BoostGaugeVisible
	script.Parent.Background.Visible = BoostGaugeVisible
	script.Parent.DontTouch.Visible = BoostGaugeVisible
	script.Parent.Num.Visible = BoostGaugeVisible
	
	
	local turbo = ((totalPSI/2)*WasteGatePressure)
	local turbo2 = WasteGatePressure
	
	fix =  -turbo2 + turbo*2
	
	script.Parent.BAnalog.Rotation= 110 + (totalPSI/2)*220
	
	
script.Parent.Num.N1.TextLabel.Text = math.floor(WasteGatePressure*(3/3))
script.Parent.Num.N2.TextLabel.Text = math.floor(WasteGatePressure*(2/3))
script.Parent.Num.N3.TextLabel.Text = math.floor(WasteGatePressure*(1/3))
script.Parent.Num.N4.TextLabel.Text = math.floor(WasteGatePressure*(-1/3))
script.Parent.Num.N5.TextLabel.Text = math.floor(WasteGatePressure*(-2/3))
script.Parent.Num.N6.TextLabel.Text = math.floor(WasteGatePressure*(-3/3))


end)
-- Create component
local Notifications = Roact.PureComponent:extend(script.Name)

function Notifications:init()
    self.Active = true
    self:setState({
        ShouldWarnAboutHttpService = false;
        ShouldWarnAboutUpdate = false;
    })

    fastSpawn(function ()
        local IsOutdated = self.props.Core.IsVersionOutdated()
        if self.Active then
            self:setState({
                ShouldWarnAboutUpdate = IsOutdated;
            })
        end
    end)
    fastSpawn(function ()
        local Core = self.props.Core
        local IsHttpServiceDisabled = (Core.Mode == 'Tool') and
            not Core.SyncAPI:Invoke('IsHttpServiceEnabled')
        if self.Active then
            self:setState({
                ShouldWarnAboutHttpService = IsHttpServiceDisabled;
            })
        end
    end)
end

function Notifications:willUnmount()
    self.Active = false
end

function Notifications:render()
    return new('ScreenGui', {}, {
        Container = new('Frame', {
            AnchorPoint = Vector2.new(0.5, 0.5);
            BackgroundTransparency = 1;
            Position = UDim2.new(0.5, 0, 0.5, 0);
            Size = UDim2.new(0, 300, 1, 0);
        }, {
            Layout = new('UIListLayout', {
                Padding = UDim.new(0, 10);
                FillDirection = Enum.FillDirection.Vertical;
                HorizontalAlignment = Enum.HorizontalAlignment.Left;
                VerticalAlignment = Enum.VerticalAlignment.Center;
                SortOrder = Enum.SortOrder.LayoutOrder;
            });
            UpdateNotification = (self.state.ShouldWarnAboutUpdate or nil) and new(NotificationDialog, {
                LayoutOrder = 1;
                ThemeColor = Color3.fromRGB(255, 170, 0);
                NoticeText = 'This version of Building Tools is <b>outdated.</b>';
                DetailText = (self.props.Core.Mode == 'Plugin') and
                    'To update plugins, go to\n<b>PLUGINS</b> > <b>Manage Plugins</b> :-)' or
                    'Own this place? Simply <b>reinsert</b> the Building Tools model.';
                OnDismiss = function ()
                    self:setState({
                        ShouldWarnAboutUpdate = false;
                    })
                end;
            });
            HTTPEnabledNotification = (self.state.ShouldWarnAboutHttpService or nil) and new(NotificationDialog, {
                LayoutOrder = 0;
                ThemeColor = Color3.fromRGB(255, 0, 4);
                NoticeText = 'HTTP requests must be <b>enabled</b> for some features of Building Tools to work, including exporting.';
                DetailText = 'Own this place? Edit it in Studio, and toggle on\nHOME > <b>Game Settings</b> > Security > <b>Allow HTTP Requests</b> :-)';
                OnDismiss = function ()
                    self:setState({
                        ShouldWarnAboutHttpService = false;
                    })
                end;
            });
        });
    })
end

return Notifications
--- Helper method that registers types from all module scripts in a specific container.
function Registry:RegisterTypesIn (container)
	for _, object in pairs(container:GetChildren()) do
		if object:IsA("ModuleScript") then
			object.Parent = self.Cmdr.ReplicatedRoot.Types

			require(object)(self)
		else
			self:RegisterTypesIn(object)
		end
	end
end
-- Checks for conditions for enabling/disabling the active controller and updates whether the active controller is enabled/disabled
function ControlModule:UpdateActiveControlModuleEnabled()
	-- helpers for disable/enable
	local disable = function()
		self.activeController:Enable(false)

		if self.moveFunction then
			self.moveFunction(Players.LocalPlayer, Vector3.new(0,0,0), true)
		end
	end

	local enable = function()
		if self.activeControlModule == ClickToMove then
			-- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls.
			-- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only jump.
			self.activeController:Enable(
				true,
				Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice,
				self.touchJumpController
			)
		elseif self.touchControlFrame then
			self.activeController:Enable(true, self.touchControlFrame)
		else
			self.activeController:Enable(true)
		end
	end

	-- there is no active controller
	if not self.activeController then
		return
	end

	-- developer called ControlModule:Disable(), don't turn back on
	if not self.controlsEnabled then
		disable()
		return
	end

	-- GuiService.TouchControlsEnabled == false and the active controller is a touch controller,
	-- disable controls
	if not GuiService.TouchControlsEnabled and UserInputService.TouchEnabled and
			(self.activeControlModule == ClickToMove or self.activeControlModule == TouchThumbstick or
			self.activeControlModule == DynamicThumbstick) then
		disable()
		return
	end

	-- no settings prevent enabling controls
	enable()
end

function ControlModule:Enable(enable: boolean?)
	if enable == nil then
		enable = true
	end
	self.controlsEnabled = enable

	if not self.activeController then
		return
	end

	self:UpdateActiveControlModuleEnabled()
end
--[[ Constants ]]--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png"

local DYNAMIC_THUMBSTICK_ACTION_NAME = "DynamicThumbstickAction"
local DYNAMIC_THUMBSTICK_ACTION_PRIORITY = Enum.ContextActionPriority.High.Value

local MIDDLE_TRANSPARENCIES = {
	1 - 0.89,
	1 - 0.70,
	1 - 0.60,
	1 - 0.50,
	1 - 0.40,
	1 - 0.30,
	1 - 0.25
}
local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES

local FADE_IN_OUT_BACKGROUND = true
local FADE_IN_OUT_MAX_ALPHA = 0.35

local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3
local FADE_IN_OUT_BALANCE_DEFAULT = 0.5
local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

local LocalPlayer = Players.LocalPlayer
if not LocalPlayer then
	Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	LocalPlayer = Players.LocalPlayer
end
--------END LIGHT SET 1--------
--------DJ BACKLIGHT--------

game.Workspace.djbacklight.l1.BrickColor = BrickColor.new(194)
game.Workspace.djbacklight.l2.BrickColor = BrickColor.new(194)
game.Workspace.djbacklight.l3.BrickColor = BrickColor.new(194)
game.Workspace.djbacklight.l4.BrickColor = BrickColor.new(194)
--script.Parent.Parent.Parent.Sound.Idle:Play()
--script.Parent.Parent.Parent.Sound.Grab:Stop()
script.Disabled = true
--
leftshoulderclone = leftshoulder:Clone()
leftshoulderclone.Name = "LeftShoulderClone"
leftshoulderclone.Parent = torso
leftshoulderclone.Part0 = torso
-- / Workspace Assets / --
local GameHolder = game.Workspace.GameHolder
local GamemodesMapHolder = GameHolder.GamemodesMapHolder
local GameAssetsHolder = GameHolder.GameAssetsHolder

local Lobby = game.Workspace.Lobby
-- Called when the player's character is added.
-- Sets up mirroring of the player's head for first person.

function FpsCamera:OnCharacterAdded(character)
	local mirrorBin = self.MirrorBin
	
	if mirrorBin then
		mirrorBin:ClearAllChildren()
		mirrorBin.Parent = nil
	end
	
	self.HeadMirrors = {}
	
	for _,desc in pairs(character:GetDescendants()) do
		self:AddHeadMirror(desc)
	end
	
	self:Connect("AddHeadMirror", character.DescendantAdded)
	self:Connect("RemoveHeadMirror", character.DescendantRemoving)
end
--[=[
	Service bags handle recursive initialization of services, and the
	retrieval of services from a given source. This allows the composition
	of services without the initialization of those services becoming a pain,
	which makes refactoring downstream services very easy.

	This also allows multiple copies of a service to exist at once, although
	many services right now are not designed for this.

	```lua
	local serviceBag = ServiceBag.new()

	serviceBag:GetService({
		Init = function(self)
			print("Service initialized")
		end;
	})
	serviceBag:Init()
	serviceBag:Start()
	```

	@class ServiceBag
]=]

local require = require(script.Parent.loader).load(script)

local Signal = require("Signal")
local BaseObject = require("BaseObject")
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder)
	dialogueFolder.Parent.OrbThrow.Use:Fire(player.Character)
	delay(4,function()
		print("New character")
		game.ReplicatedStorage.Events.System.NewCharacterServer:Fire(player)
	end)
	
end
-- Initialization

game.StarterGui.ResetPlayerGuiOnSpawn = false
ScreenGui.Parent = Player.PlayerGui
--[[
	Manages batch updating of tween objects.
]]

local RunService = game:GetService("RunService")

local Package = script.Parent.Parent
local Types = require(Package.Types)
local lerpType = require(Package.Animation.lerpType)
local getTweenRatio = require(Package.Animation.getTweenRatio)
local updateAll = require(Package.Dependencies.updateAll)

local TweenScheduler = {}

type Set<T> = {[T]: any}
type Tween = Types.Tween<any>

local WEAK_KEYS_METATABLE = {__mode = "k"}
--[[**
	Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace. This function is also called when you call a Janitor Object (so it can be used as a destructor callback).
	@returns [t:void]
**--]]
function Janitor.__index:Cleanup()
	if not self.CurrentlyCleaning then
		self.CurrentlyCleaning = nil
		for Object, MethodName in next, self do
			if Object == IndicesReference then
				continue
			end

			if MethodName == true then
				Object()
			else
				local ObjectMethod = Object[MethodName]
				if ObjectMethod then
					ObjectMethod(Object)
				end
			end

			self[Object] = nil
		end

		local This = self[IndicesReference]
		if This then
			for Index in next, This do
				This[Index] = nil
			end

			self[IndicesReference] = {}
		end

		self.CurrentlyCleaning = false
	end
end
----------------------------------
------------VARIABLES-------------
----------------------------------

InputService = game:GetService("UserInputService")
Mouse = Player:GetMouse()
TextBoxFocused = false
FocusLost = false
ShiftLock = false
--[=[
	@interface Extension
	@within Component
	.ShouldConstruct ExtensionConstructFn?
	.Constructing ExtensionFn?
	.Constructed ExtensionFn?
	.Starting ExtensionFn?
	.Started ExtensionFn?
	.Stopping ExtensionFn?
	.Stopped ExtensionFn?

	An extension allows the ability to extend the behavior of
	components. This is useful for adding injection systems or
	extending the behavior of components by wrapping around
	component lifecycle methods.

	A special `ShouldConstruct` function can be used to indicate
	if the component should actually be created. This must
	return `true` or `false`. A component with multiple
	`ShouldConstruct` extension functions must have them _all_
	return `true` in order for the component to be constructed.
	The `ShouldConstruct` function runs _before_ all other
	extension functions and component lifecycle methods.

	For instance, an extension could be created to simply log
	when the various lifecycle stages run on the component:

	```lua
	local Logger = {}
	function Logger.Constructing(component) print("Constructing", component) end
	function Logger.Constructed(component) print("Constructed", component) end
	function Logger.Starting(component) print("Starting", component) end
	function Logger.Started(component) print("Started", component) end
	function Logger.Stopping(component) print("Stopping", component) end
	function Logger.Stopped(component) print("Stopped", component) end

	local MyComponent = Component.new({Tag = "MyComponent", Extensions = {Logger}})
	```

	Sometimes it is useful for an extension to control whether or
	not a component should be constructed. For instance, if a
	component on the client should only be instantiated for the
	local player, an extension might look like this, assuming the
	instance has an attribute linking it to the player's UserId:

	```lua
	local player = game:GetService("Players").LocalPlayer

	local OnlyLocalPlayer = {}
	function OnlyLocalPlayer.ShouldConstruct(component)
		local ownerId = component.Instance:GetAttribute("OwnerId")
		return ownerId == player.UserId
	end

	local MyComponent = Component.new({Tag = "MyComponent", Extensions = {OnlyLocalPlayer}})
	```
]=]
type Extension = {
	ShouldConstruct: ExtensionConstructFn?,
	Constructing: ExtensionFn?,
	Constructed: ExtensionFn?,
	Starting: ExtensionFn?,
	Started: ExtensionFn?,
	Stopping: ExtensionFn?,
	Stopped: ExtensionFn?,
}
--[[
This was created by realgms took some inspiration from ER:LC on the ui

watch my yt video on how to set it up https://youtu.be/_x6XG6RcHec
]]



local part = script.Parent

part.Touched:Connect(function(hit)
	script.Parent.BeingTouched.Value = true -- set the flag to true when the part is touched
end)

part.TouchEnded:Connect(function(hit)
	script.Parent.BeingTouched.Value = false -- set the flag to false when the part is no longer being touched
end)
--[=[
	@param instance Instance
	@return RBXScriptConnection
	Attaches the trove to a Roblox instance. Once this
	instance is removed from the game (parent or ancestor's
	parent set to `nil`), the trove will automatically
	clean up.

	:::caution
	Will throw an error if `instance` is not a descendant
	of the game hierarchy.
	:::
]=]
function Trove:AttachToInstance(instance: Instance)
	assert(instance:IsDescendantOf(game), "Instance is not a descendant of the game hierarchy")
	return self:Connect(instance.Destroying, function()
		self:Destroy()
	end)
end