So in my game i have a custom player list with options like Friending/Unfriending/Blocking/Unblocking players. After the new topbar update i noticed that the block/unblock option doesn’t work. So i looked at the output and there was an error saying
“SetCore PromptBlockPlayer has not been registered by CoreScripts”
To reproduce this, just try calling game.StarterGui:SetCore("PromptBlockPlayer"). or use the following function:
local StarterGui = game:GetService("StarterGui")
local LocalPlayer = game.Players.LocalPlayer
local function BlockPlayerAsync(playerToBlock)
if playerToBlock and LocalPlayer ~= playerToBlock then
local blockUserId = playerToBlock.UserId
if blockUserId > 0 then
local success, result
repeat
success, result = pcall(function()
StarterGui:SetCore("PromptBlockPlayer", playerToBlock)
end)
if success then
print("success")
break
else
warn("BlockPlayerAsync() Failed Because "..result)
end
wait()
until success == true
if success then
return true
else
warn("BlockPlayerAsync() Failed Because "..result)
end
end
end
return false
end
Heres Proof Of the error:
According to the developer hub it souldn’t error since i execute it far after the core scripts sould have register the SetCore StarterGui:SetCore
Extra Details
This error basically replicates every time i try to run the SetCore(“PromptBlockPlayer”, playerInstance) All the parameters are correct and i run this core from a local script like is inteded to. I wand to also report than this error started appearing after the new topbar update, but i don’t know if this has anything to do with the bug itself.
Yes this can happend but the registration sould already have happend after 5 or 10 minutes. If you try it you will see that the function doesn’t work even after enough time.
Also don’t compare this SetCore as a delay since is not meant be run when the game starts.
What? It totally does. Please read more carefully:
The first parameter to SetCore is a string that selects the functionality with which the call will interact: a CoreScript must have registered such a string already (if one hasn’t, an error is raised). It may be necessary to make multiple calls to SetCore using pcall in case the respective CoreScript has yet to load (or if it has been disabled entirely).
You’re meant to pcall and retry. Don’t assume core items will always have the same priority in terms of registration (e.g. they may be available on the first possible frame today, but that doesn’t mean they will be tomorrow, etc. Always assume that registration may be delayed for some time or registration may never happen at all)