I am currently making a custom leaderboard ui and im having issues with the :SetCore(“PromptUnblockPlayer”) feature. All other setcore functions are working but whenever i block a player and then try to unblock it always shows up with this:
is there any way to fix this? this is my code for it:
buttons.Unblock.MouseButton1Click:Connect(function()
if selectedplayer.Value ~= "nil" and game.Players:FindFirstChild(selectedplayer.Value) and game.Players.LocalPlayer.Name ~= selectedplayer.Value then
game:GetService("StarterGui"):SetCore("PromptUnblockPlayer", game.Players:FindFirstChild(selectedplayer.Value))
end
end)
Make sure there are no error outputs on the console. And try to manually run the method by yourself with the command line.
And make sure the other player is actually blocked.
I made a system where if my alt joins, it checks if its blocked and then prompts an unblock if it actually is blocked. Even then it still results in a error.
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == "Harv3yGaming2" then
wait(5)
local blockedUserIds = game:GetService("StarterGui"):GetCore("GetBlockedUserIds")
for _, blockedUserId in ipairs(blockedUserIds) do
local blockedPlayer = game:GetService("Players"):GetPlayerByUserId(blockedUserId)
if blockedPlayer == plr then
game:GetService("StarterGui"):SetCore("PromptUnblockPlayer", plr)
end
end
end
end)
It might be an internal issue. It looks like your actions are right even after looking at the documentation.
Maybe you can set up a pcall to repeatedly send unlock requests to check if it’s because the corescript not loading yet.
Alright, ill keep the option of blocking people out of the leaderboard for now then if that doesnt work and check back up on it every now and again to see if i can re-implement blocking. Thanks for letting me know.
This might actually be an issue within Roblox since the GUI you are showing appears to be an older (probably deprecated) GUI. Though, I could be wrong so dont trust me 100%.