Roblox/luau_corpus huggingface dataset:
-- DRIVE LOOP
----------------------------------------
while true do

	-- Valores de entrada retirados do VehicleSeat
	local steerFloat = vehicleSeat.SteerFloat  -- Direção para frente e para trás, entre -1 e 1
	local throttle = vehicleSeat.ThrottleFloat  -- Direção esquerda e direita, entre -1 e 1

	-- Converte "steerFloat" em um ângulo para os servos HingeConstraint
	local turnAngle = steerFloat * MAX_TURN_ANGLE
	wheelHingeR.TargetAngle = turnAngle
	wheelHingeL.TargetAngle = turnAngle

	-- Aplique torque aos motores CylindricalConstraint dependendo da entrada do acelerador e da velocidade atual do carro
	local currentVel = getAverageVelocity()
	local targetVel = 0
	local motorTorque = 0

	-- Em marcha lenta
	if math.abs(throttle) < 0.1 then
		motorTorque = 100

	-- Accelerating
	elseif math.abs(throttle * currentVel) > 0 then
		-- Reduzir o torque com a velocidade (se o torque fosse constante, haveria um solavanco atingindo a velocidade alvo)
		-- Isso também produz uma redução na velocidade ao girar
		local r = math.abs(currentVel) / MAX_SPEED
		-- O torque deve ser mais sensível à entrada em baixa aceleração do que alta, portanto, esquadre o valor de "acelerador"
		motorTorque = math.exp( - 3 * r * r ) * TORQUE * throttle * throttle
		targetVel = math.sign(throttle) * 10000  -- Número grande arbitrário

		-- Frenagem
	else
		motorTorque = BRAKING_TORQUE * throttle * throttle
	end

	-- Use funções auxiliares para aplicar torque e velocidade alvo a todos os motores
	setMotorTorque(motorTorque)
	setMotorVelocity(targetVel)
	wait()
end
--[=[
	@param keyCodeOne Enum.KeyCode
	@param keyCodeTwo Enum.KeyCode
	@return areKeysDown: boolean

	Returns `true` if both keys are down. Useful for key combinations.

	```lua
	local shiftA = keyboard:AreKeysDown(Enum.KeyCode.LeftShift, Enum.KeyCode.A)
	if shiftA then ... end
	```
]=]
function Keyboard:AreKeysDown(keyCodeOne, keyCodeTwo)
	return self:IsKeyDown(keyCodeOne) and self:IsKeyDown(keyCodeTwo)
end


function Keyboard:_setup()

	self._trove:Connect(UserInputService.InputBegan, function(input, processed)
		if processed then return end
		if input.UserInputType == Enum.UserInputType.Keyboard then
			self.KeyDown:Fire(input.KeyCode)
		end
	end)

	self._trove:Connect(UserInputService.InputEnded, function(input, processed)
		if processed then return end
		if input.UserInputType == Enum.UserInputType.Keyboard then
			self.KeyUp:Fire(input.KeyCode)
		end
	end)

end
--[[
	Reference renderer intended for use in tests as well as for documenting the
	minimum required interface for a Roact renderer.
]]

local NoopRenderer = {}

function NoopRenderer.isHostObject(target)
	-- Attempting to use NoopRenderer to target a Roblox instance is almost
	-- certainly a mistake.
	return target == nil
end

function NoopRenderer.mountHostNode(reconciler, node)
end

function NoopRenderer.unmountHostNode(reconciler, node)
end

function NoopRenderer.updateHostNode(reconciler, node, newElement)
	return node
end

return NoopRenderer
--[[
	Called when the goal state changes value; this will initiate a new tween.
	Returns false as the current value doesn't change right away.
]]
function class:update()
	self._prevValue = self._currentValue
	self._nextValue = self._goalState:get(false)

	self._currentTweenStartTime = os.clock()
	self._currentTweenInfo = self._tweenInfo

	local tweenDuration = self._tweenInfo.DelayTime + self._tweenInfo.Time
	if self._tweenInfo.Reverses then
		tweenDuration += self._tweenInfo.Time
	end
	tweenDuration *= self._tweenInfo.RepeatCount
	self._currentTweenDuration = tweenDuration

	-- start animating this tween
	TweenScheduler.add(self)
	return false
end

function class:setCurrentValue(Value)
	self._goalState:set(Value)
end

if ENABLE_PARAM_SETTERS then

	--[[
		Specifies a new TweenInfo to use when the goal state changes in the future.
	]]
	function class:setTweenInfo(newTweenInfo: TweenInfo)
		self._tweenInfo = newTweenInfo
	end

end

local function Tween(goalState: Types.State<Types.Animatable>, tweenInfo: TweenInfo?)
	local currentValue = goalState:get(false)

	local self = setmetatable({
		type = "State",
		kind = "Tween",
		dependencySet = {[goalState] = true},
		-- if we held strong references to the dependents, then they wouldn't be
		-- able to get garbage collected when they fall out of scope
		dependentSet = setmetatable({}, WEAK_KEYS_METATABLE),
		_goalState = goalState,
		_tweenInfo = tweenInfo or TweenInfo.new(),

		_prevValue = currentValue,
		_nextValue = currentValue,
		_currentValue = currentValue,

		-- store current tween into separately from 'real' tween into, so it
		-- isn't affected by :setTweenInfo() until next change
		_currentTweenInfo = tweenInfo,
		_currentTweenDuration = 0,
		_currentTweenStartTime = 0
	}, CLASS_METATABLE)

	initDependency(self)
	-- add this object to the goal state's dependent set
	goalState.dependentSet[self] = true

	return self
end

return Tween
-- @outline // RUNNERS
function Camera.ClientUpdate(dt : number)
	if not Camera.Enabled then return end
	
	Cam.CameraType = Enum.CameraType.Scriptable
	Cam.CFrame = Camera:GetCFrame(dt)
end

return Camera
--[[
	Returns a new promise that:
		* is resolved when all input promises resolve
		* is rejected if ANY input promises reject
]]
function Promise.all(...)
	local promises = {...}

	-- check if we've been given a list of promises, not just a variable number of promises
	if type(promises[1]) == "table" and promises[1]._type ~= "Promise" then
		-- we've been given a table of promises already
		promises = promises[1]
	end

	return Promise.new(function(resolve, reject)
		local isResolved = false
		local results = {}
		local totalCompleted = 0
		local function promiseCompleted(index, result)
			if isResolved then
				return
			end

			results[index] = result
			totalCompleted = totalCompleted + 1

			if totalCompleted == #promises then
				resolve(results)
				isResolved = true
			end
		end

		if #promises == 0 then
			resolve(results)
			isResolved = true
			return
		end

		for index, promise in ipairs(promises) do
			-- if a promise isn't resolved yet, add listeners for when it does
			if promise._status == Promise.Status.Started then
				promise:andThen(function(result)
					promiseCompleted(index, result)
				end):catch(function(reason)
					isResolved = true
					reject(reason)
				end)

			-- if a promise is already resolved, move on
			elseif promise._status == Promise.Status.Resolved then
				promiseCompleted(index, unpack(promise._value))

			-- if a promise is rejected, reject the whole chain
			else --if promise._status == Promise.Status.Rejected then
				isResolved = true
				reject(unpack(promise._value))
			end
		end
	end)
end
--How to do:
--Put BassParts in body
--And this script in DriverSeat
--Please make sure to have the songMod installed!

if script.Parent:IsA("VehicleSeat") then
	script.Parent.ChildAdded:connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
			local p= game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			local g= script.SendRgb:Clone()
			g.Parent=p.PlayerGui
			g.src.Value = script.RgbEvent
			g.Disabled = false	
		end
	end)
	script.Parent.ChildRemoved:Connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent).PlayerGui.SendRgb:Destroy()
		end
	end)
end

script.RgbEvent.OnServerEvent:Connect(function(plr)
	local body = script.Parent.Parent.Body
	if body:FindFirstChild("LightPart") then
		local lightPart = body:FindFirstChild("LightPart")
		if lightPart.PointLight.Enabled == false then
			lightPart.PointLight.Enabled = true
		else
			lightPart.PointLight.Enabled = false
		end
	end
end)
-- ProductId 1218011973 for 500 Cash
developerProductFunctions[Config.DeveloperProductIds["500 Cash"]] = function(receipt, player)
	-- Logic/code for player buying 500 Cash (may vary)
	local leaderstats = player:FindFirstChild("leaderstats")
	local cash = leaderstats and leaderstats:FindFirstChild("Cash")
	if cash then
		if Utilities:OwnsGamepass(player, gamepassID) then
			cash.Value += 1000
		else
			cash.Value += 500
		end
		return true
	end
end
--[[**
	Gets the player's role in the given group.
	@param [Instance<Player>] Player The player you are checking for. Can also be their UserID.
	@param [Integer] GroupID The ID of the group you are checking role in.
	@returns [String] The player's role.
**--]]
function GroupService:GetRoleInGroupAsync(Player, GroupID)
	for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do
		if Group.Id == GroupID then
			return Group.Role
		end
	end

	return DEFAULT_ROLE
end
--Stop disliking it put it in starterplayerscripts
script.Parent:WaitForChild("PlayerModule"):WaitForChild("CameraModule"):WaitForChild("MouseLockController"):WaitForChild("BoundKeys").Value = "LeftControl"
-- Roact
local Roact = require(Vendor:WaitForChild 'Roact')
local new = Roact.createElement
----------------------------------------------------------------------
--
-- HERE BE DRAGONS!
--
-- You can hack together your own scripts using the objects
-- in here, but this is all highly experimental and *WILL BREAK*
-- in a future release. If that bothers you, look away...
--
-- T
--
-----------------------------------------------------------------------

local Board = script.Parent
local Controller
local Gyro
local CoastingAnim
local KickAnim
local LeftAnim
local RightAnim
local OllieAnim

local OllieHack = script.Parent:FindFirstChild("OllieThrust")
if (OllieHack == nil) then
	OllieHack = Instance.new("BodyThrust")
	OllieHack.Name = "OllieThrust"
	OllieHack.force = Vector3.new(0,0,0)
	OllieHack.location = Vector3.new(0,0,-2)
	OllieHack.Parent = Board
end

local lastaction = nil
local lasttime = nil
local jumpok = true

function didAction(action)
	lastaction = action
	lasttime = time()
end



function onAxisChanged(axis)
	Board.Steer = Controller.Steer
	Board.Throttle = Controller.Throttle

	if (Board.Steer == -1) then
		print("Left")
		--CoastingAnim:Stop(1)
		KickAnim:Stop()
		OllieAnim:Stop()
		RightAnim:Stop(.5)
		LeftAnim:Play(.5)
		didAction("left")
	end

	if (Board.Steer == 1) then
		print("Right")
		KickAnim:Stop()
		--CoastingAnim:Stop(1)
		LeftAnim:Stop(.5)
		OllieAnim:Stop()
		RightAnim:Play(.5)
		didAction("right")
	end

	if (Board.Steer == 0) then
		print("Straight")

		KickAnim:Stop()
		LeftAnim:Stop(.5)
		OllieAnim:Stop()
		RightAnim:Stop(.5)
		
		if (lastaction == "go" and time() - lasttime < .1) then
			
		end
		didAction("go")
		--CoastingAnim:Play(1)

		
	end
end

function enterAirState()
	-- gyrate towards vertical position for better landing
	Gyro.maxTorque = Vector3.new(100, 0, 100)
	jumpok = false
end

function exitAirState()
	-- turn off gyro
	Gyro.maxTorque = Vector3.new(0,0,0)
	jumpok = true
end

function enterPushingState()
	KickAnim:Play()
end

function onMoveStateChanged(newState, oldState)
	print(oldState)
	print(newState)
	-- do state exits here
	if oldState == Enum.MoveState.AirFree then exitAirState() end

	-- do state transitions here

	-- do state entries here
	if newState == Enum.MoveState.AirFree then enterAirState() end
	if newState == Enum.MoveState.Pushing then enterPushingState() end
end
--this is a little bad, but shouldn't really be part of the 'class' of the gun
local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
function CheckIntangible(hitObj)
	print(hitObj.Name)
	return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
end

function CastRay(startpos, vec, length, ignore, delayifhit)
	if length > 999 then
		length = 999
	end
	hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
	if hit ~= nil then
		if CheckIntangible(hit) then
			if delayifhit then
				wait()
			end
			hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
		end
	end
	return hit, endpos2
end

function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
	local dis = 2 --(beamstart - beamend).magnitude
	local tlaser=templatePart:Clone()
	tlaser.BrickColor = clr
	tlaser.Size = Vector3.new(.1, .1, dis + .2)
	tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
	tlaser.Parent = game.Workspace
	game.Debris:AddItem(tlaser, fadedelay)
end
--[[ Public API ]]--
function MasterControl:Init()
	RunService:BindToRenderStep("MasterControlStep", Enum.RenderPriority.Input.Value, updateMovement)
end

function MasterControl:Enable()
	areControlsEnabled = true
	isJumpEnabled = true
	
	if self.ControlState.Current then
		self.ControlState.Current:Enable()
	end
end

function MasterControl:Disable()
	
	if self.ControlState.Current then
		self.ControlState.Current:Disable()
	end
	
	--After current control state is disabled, moveValue has been set to zero,
	--Call updateMovement one last time to make sure this propagates to the engine -
	--Otherwise if disabled while humanoid is moving, humanoid won't stop moving.
	updateMovement()
	
	isJumping = false
	areControlsEnabled = false
end

function MasterControl:EnableJump()
	isJumpEnabled = true
	if areControlsEnabled and self.ControlState:IsTouchJumpModuleUsed() then
		self.TouchJumpModule:Enable()
	end
end

function MasterControl:DisableJump()
	isJumpEnabled = false
	if self.ControlState:IsTouchJumpModuleUsed() then
		self.TouchJumpModule:Disable()
	end
end

function MasterControl:AddToPlayerMovement(playerMoveVector)
	moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, moveValue.Z + playerMoveVector.Z)
end

function MasterControl:GetMoveVector()
	return moveValue
end

function MasterControl:SetIsJumping(jumping)
	if not isJumpEnabled then return end
	isJumping = jumping
	local humanoid = self:GetHumanoid()
	if humanoid and not humanoid.PlatformStand then
		humanoid.Jump = isJumping
	end
end

function MasterControl:DoJump()
	if not isJumpEnabled then return end
	local humanoid = self:GetHumanoid()
	if humanoid then
		humanoid.Jump = true
	end
end

function MasterControl:GetClickToMoveFailStateChanged()
	return clickToMoveFailStateChanged
end

return MasterControl
--This script creates a leaderstat and saves it with the DataStoreService.
--Put this inside of the ServerScriptService.


local stat = "Equipped" --Change to your stat name
local startamount = "Light" --Change to how much points the player will start out with


local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("LeaderStatSave")
--------------------
--| Script Logic |--
--------------------

BaseShot = Instance.new('Part')
BaseShot.Name = 'Effect'
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.BrickColor = BrickColor.new('Lime green')
SelectionBoxify(BaseShot)
Light(BaseShot)
HitFadeSound:Clone().Parent = BaseShot

Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
Tool.Activated:connect(OnActivated)
--Wait until at least the first Heartbeat so we can ensure any other ClientWeaponsScript instances have time to get started as well.
RunService.Heartbeat:Wait()
--[=[
	@within TableUtil
	@function Find
	@param tbl table
	@param callback (value: any, index: any, tbl: table) -> boolean
	@return (value: any?, key: any?)

	Performs a linear scan across the table and calls `callback` on
	each item in the array. Returns the value and key of the first
	pair in which the callback returns `true`.

	```lua
	local t = {
		{Name = "Bob", Age = 20};
		{Name = "Jill", Age = 30};
		{Name = "Ann", Age = 25};
	}

	-- Find first person who has a name starting with J:
	local firstPersonWithJ = TableUtil.Find(t, function(person)
		return person.Name:sub(1, 1):lower() == "j"
	end)

	print(firstPersonWithJ) --> {Name = "Jill", Age = 30}
	```

	:::caution Dictionary Ordering
	While `Find` can also be used with dictionaries, dictionary ordering is never
	guaranteed, and thus the result could be different if there are more
	than one possible matches given the data and callback function.
]=]
local function Find<K, V>(tbl: { [K]: V }, callback: (V, K, { [K]: V }) -> boolean): (V?, K?)
	for k, v in tbl do
		if callback(v, k, tbl) then
			return v, k
		end
	end
	return nil, nil
end
--// Setting things up
for ind,loc in pairs({
	_G = _G;
	game = game;
	spawn = spawn;
	script = script;
	getfenv = getfenv;
	setfenv = setfenv;
	workspace = workspace;
	getmetatable = getmetatable;
	setmetatable = setmetatable;
	loadstring = loadstring;
	coroutine = coroutine;
	rawequal = rawequal;
	typeof = typeof;
	print = print;
	math = math;
	warn = warn;
	error = error;
	assert = assert;
	pcall = pcall;
	xpcall = xpcall;
	select = select;
	rawset = rawset;
	rawget = rawget;
	ipairs = ipairs;
	pairs = pairs;
	next = next;
	Rect = Rect;
	Axes = Axes;
	os = os;
	time = time;
	Faces = Faces;
	unpack = unpack;
	string = string;
	Color3 = Color3;
	newproxy = newproxy;
	tostring = tostring;
	tonumber = tonumber;
	Instance = Instance;
	TweenInfo = TweenInfo;
	BrickColor = BrickColor;
	NumberRange = NumberRange;
	ColorSequence = ColorSequence;
	NumberSequence = NumberSequence;
	ColorSequenceKeypoint = ColorSequenceKeypoint;
	NumberSequenceKeypoint = NumberSequenceKeypoint;
	PhysicalProperties = PhysicalProperties;
	Region3int16 = Region3int16;
	Vector3int16 = Vector3int16;
	require = require;
	table = table;
	type = type;
	wait = wait;
	Enum = Enum;
	UDim = UDim;
	UDim2 = UDim2;
	Vector2 = Vector2;
	Vector3 = Vector3;
	Region3 = Region3;
	CFrame = CFrame;
	Ray = Ray;
	task = task;
	service = service
	}) do locals[ind] = loc end
--Over complicated function for instantly switching targets upon kill
local targetDeathConnection = nil
local trackedTarget = nil
function trackDeath(newTarget)
	
	if trackedTarget ~= newTarget then
		
		if targetDeathConnection then
			targetDeathConnection:Disconnect()
			targetDeathConnection = nil
		end
		
		trackedTarget = newTarget
		
		targetDeathConnection = newTarget.Parent.Humanoid.Died:Connect(function()

			
			targetDeathConnection:Disconnect()
			targetDeathConnection = nil
			
			if combat.getMunition(munition) then
				target = core.findTarget()
				if target then
					trackDeath(target)
				end
			end
		end)
	end
end

core.spawn(function()
	while myHuman.Health > 0 do
		
		
		if combat.getMunition(munition) then
			if target then
				
				--If we have a target unless we haven't attacked in 5 seconds don't switch
				if tick() - lastAttack > 5  then
					target = core.findTarget()
				end
			else
				target = core.findTarget()
			end
			
			if target then
				--Instant target switching
				trackDeath(target)
			end
		else
			--Sets target to nil when no ammo to return home and restock
			target = nil
		end
		
		wait(1)
	end
end)

myHuman.Died:Connect(function()
	crash()
	
	if targetDeathConnection then
		targetDeathConnection:Disconnect()
		targetDeathConnection = nil
	end
	
	wait(mySettings.Respawn.Time.Value)
	if mySettings.Respawn.Value then
		clone.Parent = script.Parent.Parent
	end
	script.Parent:Destroy()
end)
-- Listen for the parent part being touched
part.Touched:Connect(onTouched)
--[[
local require = function(mod, ...)
	if mod and tonumber(mod) then
		warn("Requiring Module by ID; Expand for module URL > ", {URL = "https://www.roblox.com/library/".. moduleId})
	end

	return require(mod, ...)
end
--]]

function CloneTable(tab, recursive)
	local clone = table.clone(tab)

	if recursive then
		for i,v in pairs(clone) do
			if type(v) == "table" then
				clone[i] = CloneTable(v, recursive)
			end
		end
	end

	return clone
end

local function Pcall(func, ...)
	local pSuccess, pError = pcall(func, ...)
	if not pSuccess then
		warn(pError)
		logError(pError)
	end

	return pSuccess, pError
end

local function cPcall(func, ...)
	return Pcall(function(...)
		return coroutine.resume(coroutine.create(func), ...)
	end, ...)
end

local function Routine(func, ...)
	return coroutine.resume(coroutine.create(func), ...)
end

local function GetEnv(env, repl)
	local scriptEnv = setmetatable({}, {
		__index = function(tab, ind)
			return (locals[ind] or (env or origEnv)[ind])
		end;

		__metatable = unique;
	})
	if repl and type(repl) == "table" then
		for ind, val in pairs(repl) do
			scriptEnv[ind] = val
		end
	end
	return scriptEnv
end

local function GetVargTable()
	return {
		Server = server;
		Service = service;
	}
end

local function LoadModule(plugin, yield, envVars, noEnv, isCore)
	noEnv = false --// Seems to make loading take longer when true (?)
	local isFunc = type(plugin) == "function"
	local plugin = (isFunc and service.New("ModuleScript", {Name = "Non-Module Loaded"})) or plugin
	local plug = (isFunc and plugin) or require(plugin)

	if server.Modules and type(plugin) ~= "function" then
		table.insert(server.Modules,plugin)
	end

	if type(plug) == "function" then
		if isCore then
			local ran,err = service.TrackTask("CoreModule: ".. tostring(plugin), plug, GetVargTable(), GetEnv)
			if not ran then
				warn("Core Module encountered an error while loading:", plugin)
				warn(err)
			else
				return err;
			end
		elseif yield then
			--Pcall(setfenv(plug,GetEnv(getfenv(plug), envVars)))
			local ran,err = service.TrackTask("Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable())
			if not ran then
				warn("Module encountered an error while loading:", plugin)
				warn(err)
			else
				return err;
			end
		else
			--service.Threads.RunTask("PLUGIN: "..tostring(plugin),setfenv(plug,GetEnv(getfenv(plug), envVars)))
			local ran, err = service.TrackTask("Thread: Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable())
			if not ran then
				warn("Module encountered an error while loading:", plugin)
				warn(err)
			else
				return err;
			end
		end
	else
		server[plugin.Name] = plug
	end

	if server.Logs then
		server.Logs.AddLog(server.Logs.Script,{
			Text = "Loaded "..tostring(plugin).." Module";
			Desc = "Adonis loaded a core module or plugin";
		})
	end
end;
-- Event Binding
TimeObject.Changed:connect(OnTimeChanged)
DisplayTimerInfo.OnClientEvent:connect(OnDisplayTimerInfo)

return TimerManager
--[[
	HOC that wraps a component that can be hot swapped with a GUI instance.

	Parameters:
	- guiName (string): name of GUI that is stored in the `CustomGui` folder

	Returns:
	- Function that injects the custom GUI instance into the wrapped component as a prop
]]
local function withCustomGui(guiName)
	return function(Component)
		local CustomGui = Roact.Component:extend("CustomGui")

		function CustomGui:init()
			self.StarterGui = self.props.StarterGui or StarterGui

			-- Find the custom GUI folder and clone the instance
			local instance = self.StarterGui:FindFirstChild(guiName, true)

			-- No custom GUI defined
			if not instance then
				return
			end

			-- Invalid class of GUI defined
			if not instance:IsA("Frame") then
				warn(
					string.format(
						"[FriendsLocator] Custom GUI provided expected to be Frame, got %s instead",
						instance.ClassName
					)
				)
				return
			end

			-- Clone GUI
			self.instance = instance:Clone()
		end

		function CustomGui:render()
			return Roact.createElement(
				Component,
				Cryo.Dictionary.join(self.props, {
					customGui = self.instance,
				})
			)
		end

		function CustomGui:willUnmount()
			if self.instance then
				self.instance:Destroy()
				self.instance = nil
			end
		end

		return CustomGui
	end
end

return withCustomGui