Player's Last Online

I was wondering how to get a player’s last online status and if they are online, I’ve read about this topic but understood nothing lol

Any help is appreciated :smiley:

1 Like

http://api.roblox.com/users/1/onlinestatus/

Replace 1 with the desired user id.
Not sure if Roblox allows requests to this through the client though.

I’m not sure how to do that, can you explain a bit more (like how to do it through a script, if doing it through a script is possible)

Try this function I made.
Make sure httpservice is enabled in settings.

it will return the date they were last online.

function LastOnlineDate(userId)
	local http = game:GetService("HttpService")
	local result
	local url = "https://api.rprxy.xyz/users/"..tostring(userId).."/onlinestatus/"
	local good, bad = pcall(function()
		result = http:JSONDecode(http:GetAsync(url))
	end)
	if good and result.LastOnline then
		return result.LastOnline
	else
		wait("error fetching data for".. tostring(userId))
		return false
	end
end
3 Likes

Sure! Read @AC_Starmarine 's reply. Because Roblox does not allow endpoint requests to their own domain, or rather, many of their domains. You can’t directly make a GET request using HttpService. What @AC_Starmarine replied with uses “api.rprxy.xyz” which is a sort of middleman site. It isn’t really a proxy either.

By making a GET request to a site that simply mimics the Roblox output you can in fact retrieve the data you require.

Roblox domain:

api.rprxy.xyz:

Furthermore here is a handy guide on how to use it:
https://developer.roblox.com/en-us/api-reference/class/HttpService

TLDR:
One works in studio/client and allows the GET request to be made.
The other doesn’t.

2 Likes

There is legit a plugin for google chrome in the chrome store called “btroblox” that will give you their status on the website.

That’s not what they asked for.
@iiplayblo_x wants to be able to fetch the LastOnline date through a script, meaning, in-game.

2 Likes

@iiplayblo_x how did i not get the solution? i made a function, it gave you want. the other post was just a explanation.

I understand that, at 1st I didn’t see your post and put their post as a solution. I remember changing the solution to being your’s but it didnt update :sweat_smile:
I changed it to you

thanks bro. if you need help with anything else than just dm me.

1 Like

WARNING!

RPRXY is no longer available which makes my code obsolete, you could replace the URL with your own proxy if you would like but don’t use this anymore unless you replace the URL.

1 Like