gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
local coreCall do local MAXRETRIES = 8 local StarterGui = game:GetService('StarterGui')…
- User
local coreCall do local MAX_RETRIES = 8
local StarterGui = game:GetService('StarterGui') local RunService = game:GetService('RunService') function coreCall(method, ...) local result = {} for retries = 1, MAX_RETRIES do result = {pcall(StarterGui[method], StarterGui, ...)} if result[1] then break end RunService.Stepped:Wait() end return unpack(result) endend
coreCall('SetCore', 'All', false)
what if i want to re
this is hard to understand for a beginner. rewrite it to be beginner - friendly, also i don't want a max retry. i want the script to continuously try.
- Assistant
Certainly! Let's simplify this script to make it more beginner-friendly and allow it to continuously try without a maximum retry limit.
Here's the simplified and more beginner-friendly version:
-- Constants local StarterGui = game:GetService('StarterGui') local RunService = game:GetService('RunService') -- Function to continuously try calling a StarterGui method local function continuouslyTry(method, ...) while true do -- Attempt to call the method local success, result = pcall(StarterGui[method], StarterGui, ...) -- Check if the method call was successful if success then return result end -- Wait for the next frame before retrying RunService.Stepped:Wait() end end -- Call the function with the desired method and arguments continuouslyTry('SetCore', 'All', false)