I am trying to get if the player is online or offline, but I don’t know how to run an API link, or how it work! I looked through the Dev Forum, but can’t understand how to get the status.
I am using this link rn.
https://api.roblox.com/users/{userid_here}/onlinestatus/
You need to send a request with the intended userid. For example mine would be:
https://api.roblox.com/users/88972160/onlinestatus/
You get a json return that gives a decent amount of information including the online status of the player with that id. Mine looked like
{"GameId":null,"IsOnline":true,"LastLocation":"Online","LastOnline":"2021-12-03T00:53:17.67-06:00","LocationType":2,"PlaceId":null,"VisitorId":88972160,"PresenceType":1,"UniverseId":null,"Visibility":0}
Like I said, I am so confused how it works, I don’t even know how to send a request.
are you sending it from roblox servers or an external server
local HttpsService = game:GetService("HttpService")
local Link = "https://api.roproxy.com/users/1712787111/onlinestatus"
local PlayerData = HTTPs:JSONDecode(HTTPs:GetAsync(Link))
print(PlayerData) -- returns tabel
Check https service in DevWIki
It gives me an error saying
“Http requests can only be executed by game server - Client - LocalScript:5”
U can use http service in the server only
(script not local script)
https://developer.roblox.com/en-us/api-reference/class/HttpService
I’ll link it in case anyone wasn’t sure.
u cant send requests to roblox from roblox
u can actually
using proxy servers
yes i know, but they aren’t supported/funded by roblox
but it works and roblox allow to use proxy servers