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

How should I detected if a player is online or offline?

How would I check if a player is online. Like so like if ROBLOX was online a script that would be called would check if he is online or offline. I am thinking of a roblox api that does this, but I cannot find any. Help?

2 answers

✓ Accepted answer

I found the exact same question from a post 2 years ago. Hope this helps!

1 comment

0

post didn't work updated answer

I have solved this myself here is the code:

function getOnlineStatus(username)
	local proxy = "https://www.rprxy.xyz"
	local id = game.Players:GetUserIdFromNameAsync(username)
	local httpService = game:GetService("HttpService")
	local user = httpService:GetAsync(proxy .. "/users/" .. id .. "/profile", true)
	return (string.find(user, "icon%-game") ~= nil) or (string.find(user, "icon%-online") ~= nil) or (string.find(user, "icon%-studio") ~= nil)
end

returns true if the user is online return false if they are offline

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