Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to check a playerid if they're not in-game?

I'm making a blacklist script, that keeps the player off the leaderboard. The only problem with the script is this line:

if plr.UserId == game.Players:GetUserIdFromNameAsync(v) then

I'm not what to replace it with, as that line only checks the player in-game. As "plr" is the playeradded function.

Please help me out if you can.

3 comments

3

Include your full script, there's nothing we can do with this if you won't give us anything regarding the context of this.

1

what is v, what is the error in your output, and what do you want it to do?

0

Are HTTP services enabled? GetUserIdFromNameAsync sends a query to the Roblox servers so that could be the problem. Also it is very recommended that you surround GetUserIdFromNameAsync with pcall.

1 answer

✓ Accepted answer

You don't really need to, but you can use HttpService with a proxy.

local url = "http://rprxy.xyz/users/get-by-username?username="..v

local HS = game:GetService("HttpService")
local JsonTable = HS:JSONDecode(HS:GetAsync(url))

if UserId == JsonTable.Id then
	print("True")
end

This discussion is preserved as it was. New answers, comments, and votes are closed.