Hi All,
I am currently developing a URL Based ban system. The aim is to upload all bans onto a database (hosting on the cloud) when somebody is banned and to detect when somebody is banned.
Now the problem here is that Roblox can’t parse the JSON output. The URL it is trying to parse is “[redacted]/api/read.php” (yes I am aware that this is .php, but it outputs JSON, can’t seem to get it to go to . JSON or it will spit out all the PHP code). The output is below.
{"body":[{"id":"1","UserID":"51803259","BanStart":"time will go here","BanTime":"another time will go here","Reason":"I will use os.time() or something","ModUserID":"51803259"}],"itemCount":1}
Here is a beautified version
{
"body": [
{
"id": "2",
"UserID": "51803259",
"BanStart": "51803259",
"BanTime": "51803259",
"Reason": "sdffsdfdsfsdfdssfddsf",
"ModUserID": "51803259"
}
],
"itemCount": 1
}
Here is the Lua
local http = game.HttpService
local url = "https://[redacted]/api/read.php"
local data = http:GetAsync(url)
print(http:JSONDecode(data))
I only have a basic understanding of all this, so I do apologize if this makes no sense, but I am really confused.
Also, is it possible for somebody to point me in the direction of how to get Lua to read these? I will most likely have lots of database entries so it would be good to know how to (for example) list all UserID’s which are banned.