Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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
Include your full script, there's nothing we can do with this if you won't give us anything regarding the context of this. SteamG00B 1633 — 4y
1
what is v, what is the error in your output, and what do you want it to do? SteamG00B 1633 — 4y
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. Benbebop 1049 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

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
Ad

Answer this question