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

Can I check if a player is online if they aren't in-game?

I would like to have a gui in a place that can tell you which members of my group are online. I haven't been able to find any services to use yet so I can't work on the rest of the script.

Is there any way to check if a user is online on roblox? Some sort of function or service?

1 comment

1

As far as I'm aware this is impossible without HTTP services, which I know nothing about.

2 answers

✓ Accepted answer

You have to use HTTPService, so make sure HttpEnabled for the HttpService is enabled, then you can use this code as a script in ServerScriptStorage to print the online status of player's IDs that you chat when you say "status/" then the ID.

local http = game:GetService("HttpService")

game.Players.PlayerAdded:connect(function(plr)
	plr.Chatted:connect(function(msg)
		if msg:lower():sub(1,7) == "status/" then
			local id = tonumber(msg:sub(8)) --Get the ID after the "/" in "status/"
			if id ~= nil then --If the ID doesn't return nil after being converted to a number then continue.
				local status = http:GetAsync("http://apiroblox.netne.net/GetUserStatus.php?id="..id) --Get online status of the player from the ID.
				local m = Instance.new("Message", game.Workspace)
				m.Text = "Status of player ID "..id..": "..tostring(status)
				wait(3)
				m:Destroy()
			end
		end
	end)
end) 

NOTE: This will print the entire status of the player, so if they're online, it tells you what the player is doing, same as how it appears on people's profiles.

HTTP Service. This would require you to make your own website that reflected off of the information on roblox because of the rules of using HTTP Service - cannot perform on the Roblox website.

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