A way to check if player is deleted?

I’ve searched all the devforum and google, have not found a proper answer to this question.

While making my friends checker, I am in need to load HumanoidDescription from the players, via their UserId.

game:GetService("Players"):GetHumanoidDescriptionFromUserId(userId)

However. If the user account is deleted, calling this method will result in an error:
Players:GetHumanoidDescriptionFromUserId() failed because HTTP 400 (Bad Request)

Currently I wrapped this line into a pcall function, but it is not something I would love to stick to.
Is there any other way to check if the player is not deleted, in a clean and safe way?

2 Likes

do this instead

game:GetService("Players"):GetHumanoidDescriptionFromUserId(player.userId)
1 Like

Please read into the question. I have the raw UserIds, as I get them listed from the Players:GetFriendsAsync().

I need a way to safely check if the user account was not deleted by their id.

1 Like

before you fire it there, fire it to https://users.roblox.com/v1/users/1 (example user id) and see if it returns an error or not

1 Like

or you could just use a pcall, which would probably work fine too

2 Likes

That is actually a good idea, but I use this on client and will not be able to use HttpService. And calling HTTP for 200 friends every time a player joins doesn’t sound that good too…

I’m already using pcall, but I’d prefer checking it with something that is more runtime friendly.

1 Like

Im not sure what userservice will return if you try on a banned player, but maybe it will provide some sort of information

game:GetService("UserService"):GetUserInfosByUserIdsAsync({userId})
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.