Pinkstack/roblox-luau-corpus-text huggingface dataset:
--------STAGE--------



game.Workspace.back1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.back2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.crewbig1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.crewsmall1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.djstand.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.djtv.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side3.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side4.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side11.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.side12.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.sidebig1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""

if game.Workspace.CurrentStageTV.Value == "1" then
game.Workspace.main1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
end
--create tables:


for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "a" then
		table.insert(a, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "b" then
		table.insert(b, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "c" then
		table.insert(c, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "d" then
		table.insert(d, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "e" then
		table.insert(e, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "f" then
		table.insert(f, 1, part)
	end
end

function on(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = true
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = true
		end
	end
end

function off(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = false
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = false
		end
	end
end

function run() --mian

	off(a)--turns all lights off
	off(b)
	off(c)
	off(d)
	off(e)
	off(f)

	if pattern == "Flash" then
		repeat
			local w = 0.45
			off(c)
			off(d)
			on(a)
			on(b)
			on(e)
			on(f)
			wait(w)
			
			off(a)
			off(b)
			off(e)
			off(f)
			on(c)
			on(d)
			wait(w)
		
		until pattern ~= "Flash"
		return
	end

	if pattern == "Left" then
		repeat
		local w = 0.15
		on(f)
		wait(w)
		on(e)
		wait(w)
		on(d)
		wait(w)
		on(c)
		wait(w)
		on(b)
		wait(w)
		on(a)
		wait(w)
		
		off(f)
		wait(w)
		off(e)
		wait(w)
		off(d)
		wait(w)
		off(c)
		wait(w)
		off(b)
		wait(w)
		off(a)
		wait(w)
		until pattern ~= "Left"
		return
	end
	
	if pattern == "Right" then
		repeat
		local w = 0.15
		on(a)
		wait(w)
		on(b)
		wait(w)
		on(c)
		wait(w)
		on(d)
		wait(w)
		on(e)
		wait(w)
		on(f)
		wait(w)
		
		off(a)
		wait(w)
		off(b)
		wait(w)
		off(c)
		wait(w)
		off(d)
		wait(w)
		off(e)
		wait(w)
		off(f)
		wait(w)
		until pattern ~= "Right"
		return
	end
	
	if pattern == "Split" then
		repeat
		local w = 0.2
		on(c)
		on(d)
		wait(w)
		on(b)
		on(e)
		wait(w)
		on(a)
		on(f)
		wait(w)
		
		off(c)
		off(d)
		wait(w)
		off(b)
		off(e)
		wait(w)
		off(a)
		off(f)
		wait(w)
		until pattern ~= "Split"
		return
	end
end--run end
--[[



]]



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

local AvatarEditor = ReplicatedStorage.AvatarEditor
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Promise = require(AvatarEditor.Shared.Util.Promise)
local GuiLib = require(AvatarEditor.Client.GuiLib.LazyLoader)
local Theme = require(AvatarEditor.Client.Theme)

local player = Players.LocalPlayer

local Class = {}
Class.__index = Class


function Class.new(frame)
	local self = setmetatable({}, Class)
	
	self.Frame = frame
	self.ScrollingFrame = self.Frame.ScrollingFrame
	self.Maid = Maid.new()

	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame, "ScrollBarImageColor3", "Scrollbar"))
	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame.Theme.DropdownButton, "BackgroundColor3", "Tertiary"))
	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame.Theme.DropdownButton.ListFrame, "BackgroundColor3", "Tertiary"))
	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame.Theme.DropdownButton.Arrow, "ImageColor3", "Deselected"))
	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame.Theme.DropdownButton.Option, "TextColor3", "Text"))
	self.Maid:GiveTask(Theme:Bind(self.ScrollingFrame.Theme.TextLabel, "TextColor3", "Text"))
	
	local dropdownButton = self.ScrollingFrame.Theme.DropdownButton
	for i, v in ipairs(Theme:GetAll()) do
		local button = AvatarEditor.DropdownTemplate:Clone()
		button.LayoutOrder = i
		button.Text = v
		button.Name = v
		self.Maid:GiveTask(Theme:Bind(button, "BackgroundColor3", "Tertiary"))
		self.Maid:GiveTask(Theme:Bind(button, "TextColor3", "Text"))
		self.Maid:GiveTask(button)
		button.Parent = dropdownButton.ListFrame.ScrollFrame
	end
	self.Maid:GiveTask(Theme:Bind(dropdownButton.ListFrame.ScrollFrame, "ScrollBarImageColor3", "Scrollbar"))
	
	-- for some reason AutomaticCanvasSize doesnt want to work here...
	dropdownButton.ListFrame.ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, dropdownButton.ListFrame.ScrollFrame.UIListLayout.AbsoluteContentSize.Y)
	
	local themeDropdown = GuiLib.Classes.Dropdown.new(dropdownButton, dropdownButton.ListFrame)
	self.Maid:GiveTask(themeDropdown)
	
	self.Maid:GiveTask(themeDropdown.Changed:Connect(function(button)
		local theme = button.Name
		Theme:Set(theme)
	end))
	
	Promise.new(function(resolve, reject)
		local folder = player:WaitForChild("AE_Settings")
		resolve(folder)
	end)
	:andThen(function(folder)
		self.Folder = folder
		
		themeDropdown:Set(dropdownButton.ListFrame.ScrollFrame[self.Folder:GetAttribute("Theme")])
		Theme:Set(themeDropdown:Get().Name)
	end)
	:catch(warn)
	
	return self
end


function Class:Destroy()
	self.Maid:DoCleaning()
	self.Maid = nil
	setmetatable(self, nil)
end


return Class
--[[
    Instantiates object fields
]]


function VehicleSoundComponent:setup()
	local idle = CarSoundsFolder:FindFirstChild("Idle")
	local engine = CarSoundsFolder:FindFirstChild("Engine")
	local skid = CarSoundsFolder:FindFirstChild("Skid")
	local boost = CarSoundsFolder:FindFirstChild("Boost")

	self.idle = idle:Clone()
	self.engine = engine:Clone()
	self.skid = skid:Clone()
	self.boost = boost:Clone()

	self.idle.Parent = self.model.PrimaryPart
	self.engine.Parent = self.model.PrimaryPart
	self.skid.Parent = self.model.PrimaryPart
	self.boost.Parent = self.model.PrimaryPart

	self.idle.Volume = 0
	self.engine.Volume = 0
	self.skid.Volume = 0
	self.boost.Volume = 0

	self.idle:Play()
	self.engine:Play()
	self.skid:Play()
	self.boost:Play()

	coroutine.wrap(
		function()
			while self.model and self.model.Parent do
				self:updateSounds()
				wait(0.5)
			end
		end
	)()
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
	return ClassInformationTable:GetClassFolder(player,"Warlock").Firespread.Value and ClassInformationTable:GetClassFolder(player,"Warlock").FastCasting.Value ~= true
end
--------LEFT DOOR --------


game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--[[Run]]



	--Print Version
	local ver=require(car["A-Chassis Tune"].README)
	print("Novena: AC6T Loaded - Build "..ver)
	
	--Runtime Loops
	
	-- ~60 c/s
	game["Run Service"].Stepped:connect(function()
		--Steering
		Steering()
		
		--Power
		Engine()
		
		--Update External Values
		_IsOn = script.Parent.IsOn.Value
		_InControls = script.Parent.ControlsOpen.Value
		script.Parent.Values.Gear.Value = _CGear
		script.Parent.Values.RPM.Value = _RPM
		script.Parent.Values.Boost.Value = (_Boost/2)*_TPsi
		script.Parent.Values.Horsepower.Value = _HP
		script.Parent.Values.HpNatural.Value = _NH
		script.Parent.Values.HpBoosted.Value = _BH*(_Boost/2)
		script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
		script.Parent.Values.TqNatural.Value = _NT
		script.Parent.Values.TqBoosted.Value = _BT*(_Boost/2)
		script.Parent.Values.TransmissionMode.Value = _TMode
		script.Parent.Values.Throttle.Value = _GThrot*_GThrotShift
		script.Parent.Values.Brake.Value = _GBrake
		script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		script.Parent.Values.SteerT.Value = _GSteerT
		script.Parent.Values.PBrake.Value = _PBrake
		script.Parent.Values.TCS.Value = _TCS
		script.Parent.Values.TCSActive.Value = _TCSActive
		script.Parent.Values.TCSAmt.Value = 1-_TCSAmt
		script.Parent.Values.ABS.Value = _ABS
		script.Parent.Values.ABSActive.Value = _ABSActive
		script.Parent.Values.MouseSteerOn.Value = _MSteer
		script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
		
	end)
	
	--15 c/s
	while wait(.0667) do
		--Automatic Transmission
		if _TMode == "Auto" then Auto() end
		
		--Flip
		if _Tune.AutoFlip then Flip() end
	end
----------------------------------------------------##


script.Parent.ClickDetector.MouseClick:Connect(function()
	if isopen == false then
		isopen = true
		script.Parent.DoorOpen:Play()
		doormotor.Motor.DesiredAngle = -0.8
	else
		isopen = false
		script.Parent.DoorClose:Play()
		doormotor.Motor.DesiredAngle = 0
	end
end)
--[[

!Reminder!

Format to calculate hour's rotation:

90 * DateTimeTable.hour / 3 (1 to 12) or (90 * DateTimeTable.hour / 3) / 3) (12 to 24)

Every 3 hours the needle will rotate 90 degrees.

Format to calculate second's rotation:

90 * DateTimeTable.min / 15 (1 to 30) or (90 * DateTimeTable.min / 15) / 15) (30 to 60)

Every 15 minutes the needle will rotate 90 degrees.

Format to calculate second's rotation: 

90 * DateTimeTable.sec / 15 (1 to 30) or  (90 * DateTimeTable.sec / 15) / 15) (30 to 60)

Every 15 seconds the needle will rotate 90 degrees.

]]

--
--[[
	Returns the enums.Device of the DeviceInputTypePattern that matches the
	`inputType`.

	This function is called when the LocalPlayer's LastInputType has changed,
	thus possibly requiring an update to the enums.Device
]]



local ExperienceComponents = script:FindFirstAncestor("ExperienceComponents")

local constants = require(ExperienceComponents.constants)
local enums = require(ExperienceComponents.enums)
-- ROBLOX deviation END



local exports = {}
exports.DiscreteEvent = 0
exports.UserBlockingEvent = 1
exports.ContinuousEvent = 2

export type ReactFundamentalComponentInstance<C, H> = {
	currentFiber: Object,
	instance: any,
	prevProps: Object?,
	props: Object,
	impl: ReactFundamentalImpl<C, H>,
	state: Object,
}

export type ReactFundamentalImpl<C, H> = {
	displayName: string,
	reconcileChildren: boolean,
	getInitialState: nil | (Object) -> (Object),
	getInstance: (C, Object, Object) -> (H),
	getServerSideString: nil | (C, Object) -> (string),
	getServerSideStringClose: nil | (C, Object) -> (string),
	onMount: (C, any, Object, Object) -> (),
	shouldUpdate: nil | (C, Object?, Object, Object) -> (boolean),
	onUpdate: nil | (C, any, Object?, Object, Object) -> (),
	onUnmount: nil | (C, any, Object, Object) -> (),
	onHydrate: nil | (C, Object, Object) -> boolean,
	onFocus: nil | (C, Object, Object) -> boolean,
}
export type ReactFundamentalComponent<C, H> = {
	["$$typeof"]: number,
	impl: ReactFundamentalImpl<C, H>,
}

export type ReactScope = {
	["$$typeof"]: number,
}

export type ReactScopeQuery = (
	type: string,
	-- ROBLOX deviation START: leave closed to extension unless necessary
	props: { [string]: any? },
	-- ROBLOX deviation END
	instance: any
) -> boolean

export type ReactScopeInstance = {
	DO_NOT_USE_queryAllNodes: (ReactScopeQuery) -> nil | Array<Object>,
	DO_NOT_USE_queryFirstNode: (ReactScopeQuery) -> nil | Object,
	containsNode: (Object) -> boolean,
	getChildContextValues: <T>(context: ReactContext<T>) -> Array<T>,
}
--- Skill


local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
local Track1 : Animation = script:WaitForChild("Anim01")
Track1 = Player.Character:WaitForChild("Humanoid"):LoadAnimation(script.Anim01)
local PrevWalkSpeed = nil
local Tween = game:GetService("TweenService")
local Gui = Player.PlayerGui:WaitForChild("Mochi_Skill_List".. Player.Name):WaitForChild("Frame")
local Mouse = Player:GetMouse()

local Cooldown = 15

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Tool.Active.Value = "4DoughBarrage"
		PrevWalkSpeed = Player.Character:WaitForChild("Humanoid").WalkSpeed
		Gui:FindFirstChild(Tool.Active.Value).Frame.Size = UDim2.new(1, 0, 1, 0)
		Player.Character:WaitForChild("Humanoid").WalkSpeed = 5
		Track1:Play()
		Track1:AdjustSpeed(0)
		wait(0.15)
		script.Fire:FireServer("hold")
	end
end)

UIS.InputEnded:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "4DoughBarrage" then
		Debounce = false
		Tool.Active.Value = "4DoughBarrage"
		Player.Character:WaitForChild("Humanoid").WalkSpeed = 2
		Track1:AdjustSpeed(1)
		script.Fire:FireServer("release", Mouse.Hit.p)
		local hum =  Player.Character.Humanoid
		wait(1)
		Tween:Create(Gui:FindFirstChild(Tool.Active.Value).Frame, TweenInfo.new(Cooldown), {Size = UDim2.new(0, 0, 1, 0)}):Play()
		Tool.Active.Value = "None"
		Player.Character:WaitForChild("Humanoid").WalkSpeed = PrevWalkSpeed
		wait(Cooldown)
		Debounce = true
	end
end)
-- Initialize the tool


local LightingTool = {
	Name = 'Lighting Tool';
	Color = BrickColor.new 'Really black';

	-- Signals
	OnSideChanged = Signal.new();
}

LightingTool.ManualText = [[<font face="GothamBlack" size="16">Lighting Tool  🛠</font>
Lets you add point lights, surface lights, and spotlights to parts.<font size="6"><br /></font>

<b>TIP:</b> Click on the surface of any part to change a light's side quickly.]]
--[[Weight and CG]]


	Tune.Weight			= 4000		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		2.5		,
	 --[[Length]]		10		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= 1		-- 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
--[[Weight and CG]]


	Tune.Weight			= 3042		-- 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		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- 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.2		-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-- Modules


local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))

local displayValues = ReplicatedStorage:WaitForChild("DisplayValues")

local GameStatus = script.Parent
local StatusBar = GameStatus.Parent
local TimerAndStatus = StatusBar.Parent
local TopBar = TimerAndStatus.Parent
--		if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end


	
	--Determine Wheel Size
	local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end
	
	--Pre-Toggled PBrake
	for i,v in pairs(car.Wheels:GetChildren()) do if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then _PBrake.Value=true end end
-- Clear orientable body event listeners for a given player


local function onPlayerRemoving(player)
	if orientableBodies[player] then
		orientableBodies[player]:destroy()
		orientableBodies[player] = nil
	end
	if characterAddedConnections[player] then
		characterAddedConnections[player]:Disconnect()
		characterAddedConnections[player] = nil
	end
	if characterRemovingConnections[player] then
		characterRemovingConnections[player]:Disconnect()
		characterRemovingConnections[player] = nil
	end
end
---------------------------------------



local Handling = false
Grenade.Touched:connect(function(part)
	--ignore collisions with firer's stuff
	if Character and part:IsDescendantOf(Character) then return end
	if Handling then return end
	Handling = true

	--wait a second, this is a grenade so it won't explode on contact
	wait(0.1)

	--end grenade
	Grenade.Anchored = true
	Grenade.CanCollide = false
	Grenade.Transparency = 1

	--play soud
	ExplodeSound:Play()

	--do explode
-- Set Pet Canvas Size --


function PetSrollingFrame:SetTradingPlayerListCanvasSize(searchOn)
	TradingPlayerListUI.Size = UDim2.new(0.35, 0, 0.6, 0)
	
	local PADDING, SIZE, MaxCells = getSizes()
	local AbsoluteSize = ScrollingFrame.AbsoluteSize

    local NewPadding = PADDING * AbsoluteSize
    NewPadding = UDim2.new(0, NewPadding.X, 0, NewPadding.Y)
    local NewSize = SIZE * AbsoluteSize
    NewSize = UDim2.new(0, NewSize.X, 0, NewSize.Y)
	
    UIGridLayout.CellPadding = NewPadding
    UIGridLayout.CellSize = NewSize
	
	local children = ScrollingFrame:GetChildren()
	local items = 0
	if searchOn == true then
		for _, v in pairs(ScrollingFrame:GetChildren()) do
			if v:IsA("ImageLabel") and v:FindFirstChild("Data") then
				if v.Visible == true then
					items = items + 1
				end
			end
		end
	else
		items = (#children) - 1
	end
	local frameSizeY = ScrollingFrame.AbsoluteSize.Y
	local ySize = UIGridLayout.CellSize.Y.Offset
	local yPadding = UIGridLayout.CellPadding.Y.Offset
	UIGridLayout.FillDirectionMaxCells = MaxCells
	local rows = math.ceil(items / UIGridLayout.FillDirectionMaxCells)
	local pixels = rows * ySize + (rows - 1) * yPadding
	ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))
	
	if TradingPlayerListUI.Visible == false then
		TradingPlayerListUI.Size = UDim2.new(0, 0, 0, 0)
	end
end
-- Buttons


local sparklerButton = prizeGUI:WaitForChild("SparklerGeneric")
local exitButton = prizeGUI:WaitForChild("ExitButton")


local function exit()
	prizeGUI.Visible = false
end

local function openPrizeGUI()
	prizeGUI.Visible = true
end

local function openRedeem()
	prizeGUI.Visible = false
end

local function awardPrize(whichPrize)
	-- Check if backpack already has that sparkler
	local cloneObject = sparklerPrize:Clone()
	cloneObject.Parent = backpack
	
	-- MAybe equip it? 
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid") or character:WaitForChild("Humanoid")

	humanoid:EquipTool(cloneObject)
end

exitButton.MouseButton1Click:Connect(exit)

sparklerButton.MouseButton1Click:Connect(function()
	awardPrize()
end)

proximityPrize.Triggered:Connect(openPrizeGUI)
--        print("mouseleave", object,self.current)


        if (self.current == object) then
            
            --Maybe we drop down onto another object now?
            --We left, do we hover a different object?
            for key,rec in pairs(self.list) do
                
                
                
                if (key==self.current) then
                    continue --skip us
                end
                if (rec.screen ~= screen) then
                    continue
                end
                
                if (rec.hovering == true) then
                    --They're hovering but were not current, meaning they were waiting
                    
                    self.current = rec.object
                    rec.enterMethod()
                    rec.down = true
                    return
                end
            end
            self.current = nil
        end
        
    end)
    
end

function module:EnterHover(object)
    
    
    
    if (self.current == object) then
        module:LetUpAllOthers(object)
        return true
    end
    if (self.current == nil) then
        module:LetUpAllOthers(object)
        self.current = object
        return true
    end    
        
    if (object.ZIndex > self.current.ZIndex) then
        module:LetUpAllOthers(object)
        self.current = object
        return true
        
    end
    return false
end

function module:LetUpAllOthers(object) 
    
    
    local screen = object:FindFirstAncestorWhichIsA("ScreenGui")
    
    for key,rec in pairs(self.list) do
        
        if (rec.screen ~= screen) then
            continue
        end
        
        if (rec.hovering and rec.object ~= object) then
            if (rec.down == true) then
                if (rec.exitMethod) then
                    rec.exitMethod()
                end
                rec.down = false
            end
        end
    end
    
end

return module