I recently made a script that will send a message to a webhook and that post how many plays your game has every 20 mins.
while true do
local HttpService = game:GetService("HttpService"); -- Make sure to have it HTTP on
local Response = HttpService:RequestAsync({
Method = "GET";
Url = string.format("https://games.rprxy.xyz/v1/games?universeIds=%d", game.GameId); --// Send to the rprxy.xyz proxy with the current game's id
});
if (Response.Success and Response.Body) then
local Body = HttpService:JSONDecode(Response.Body) table
if (Body.data[1]) then
local Visits = Body.data[1].visits;
print(Visits)
print(1000 - Visits .." left till update" )-- this will just send into the server dev console
local http = game:GetService("HttpService")
local Data = {
["embeds"] = {{
["title"] = "Visits",
["description"] = "The game has ".. Visits.." visits Right now",
["color"] = tonumber(0x36393e),
["fields"] = {
{
["name"] = "Until 1000",
["value"] = 1000 - Visits .." visits left till 1000", --I just have this here so I know how many plays I need until I get 1000 plays in my game
["inline"] = true
}
}
}}
}
Data = http:JSONEncode(Data)
http:PostAsync("Your webhook here", Data)
wait(1200)
end
end
end
I hope this can help some people. I will say don’t use this on bigger games this could get it suspended if it floods the webhook so use this for smaller games.
This is cool and everything, but there’s a little problem. This script will run ONLY if the game has any servers up and running, otherwise the scripts won’t run. And it will run on each server, so it will send a lot of duplicates too.
Honestly this is kinda useless unless you have a game with players constantly.
Still what I said before, the script won’t run if servers aren’t open. You basically gotta have players 24/7 for this to be useful. No offense though, it’s pretty cool.
This script itself seems like an abuse of Discord API. Regardless of whether it’s put in a large or small game it’s running the same code except with different values in certain parts of the code. What’s wrong with just using the counter on the website?
If you really need an updating data counter, it would be much more advisable to create a bot that edits a message with new data as opposed to spamming a channel every 20 minutes there are live servers with the game’s current visit count.
You’re pretty noobish I can tell so let me explain: Discord is not meant for logging services, and it has been stated numerous times that it is not, even discord staff have openly stated this is not a use for discord and is not tolerated. It doesn’t matter what you think is cool.