local http = game:GetService"HttpService"
local get = http.GetAsync
local jsonDecode = http.JSONDecode
local proxyUrl = "roproxy.com" --Put your proxy's domain here.
local baseUrl = "https://api."..proxyUrl.."/users/%s/onlinestatus/"
local function getUserOnlineStatus(userId)
local requestUrl = string.format(baseUrl, userId)
print(requestUrl)
local success, result = pcall(get, http, requestUrl)
if success then
if result then
local success2, result2 = pcall(jsonDecode, http, result)
if success2 then
if result2 then
return result2
end
else
warn(result2)
end
end
else
warn(result)
end
end
local userOnlineStatus = getUserOnlineStatus(1)
print(userOnlineStatus.LastOnline) --2006-02-27T15:06:40.3-06:00
In case anyone was looking for a HttpService solution.
Is the replacement API down, I’ve noticed the past few days I can’t fetch any online user presence data. It will show everyone online anywhere from 4-5 days ago even when they’ve been online multiple times since then.