From efdfb67f00082b6e4b187c0b054b67ca297a3e6b Mon Sep 17 00:00:00 2001 From: bqmb3 Date: Sat, 27 Jul 2024 21:01:44 +0900 Subject: [PATCH] fix: admin-house extended version infinitely yielding when reinitializing --- extended/admin-house.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/extended/admin-house.lua b/extended/admin-house.lua index 5fdf33c..d60b1c7 100644 --- a/extended/admin-house.lua +++ b/extended/admin-house.lua @@ -5,13 +5,21 @@ -- @copyright bqmb3 2024 -- @see f3x-wrapper - +local plr = game:GetService('Players').LocalPlayer +function getF3XbyCommand() + game.Players:Chat('/e :f3x') + return plr.Backpack:WaitForChild('Folder', 3) +end _G.F3X__init_func = function() - if not _G.F3X__init_debounce then - _G.F3X__init_debounce = true - game.Players:Chat('/e :f3x') + if _G.F3X__init_debounce then return end + local folder + for i = 1, math.huge do + if i > 1 then + warn("Failed to get F3X. Attempt #"..tostring(i)) + end + folder = plr.Backpack:FindFirstChild("Folder") or getF3XbyCommand() + if folder then break end end - local folder = game:GetService('Players').LocalPlayer.Backpack:WaitForChild('Folder') _G.F3X__init_debounce = false return folder end