Can someone explain the following code:
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)
end
end
coreCall('SetCore', 'ResetButtonCallback', false)
Questions I had in particular were:
1) What does local coreCall do mean? Is it simply another way to define a function? Is there a special usecase?
2) Is there a reason why MAX_RETRIES is only set to 8? Wouldn't this mean if it retried 8 times then the desired effect would not occur? Wouldn't it be better to not have a MAX_RETRIES?
Thank you!
