Roblox to discord visit stats

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.

Ending results

Screen Shot 2021-05-22 at 1.26.18 PM

13 Likes

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.

3 Likes

Yes

why I said only to use it on small games

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.

2 Likes

Thanks maybe I can work on a discord bot that can do that for you and post every so often.

1 Like

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.

4 Likes

you should it would be so cool!

Please stop using discord as a freaking logging service, it has been stated so many times that is NOT the purpose of discord.

its a cool way to do it tho…??? i dont see a problem with it

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.

But its a cool way to share stats with your community

It does not matter if it’s cool or not, can you actually learn to respect rules? If you want to log stats use Sentry or Twitter.

2 Likes

discords way easier as they have webhooks and bots I don’t even know how’d you get info from roblox to twitter.

1 Like

Yes. This is an amazing reply.

While this could work I don’t know how to code a bot to look for that while I do know how to do edits to a message.

1 Like

How does the rprxy.xyz work? can you teach me?

Here is the post by Foast, the creator of rprxy.xyz . Fixing HttpService: Make PUT, PATCH, DELETE requests, access response headers, proxy to any site, and more