How to Get Game Like Count

Hey everyone! Sorry I’m on my phone and in a rush, but I would like to know how can you get my games like count from a script. I am trying to create one of those boards that display the like count and the like goal and give a reward when it reaches the goal. I tried asking ai how to do it, but it did not work.

Thank you in advance, I am going to school so might now respond!

3 Likes

I recommend doing a google on this, there are plenty of tutorials for “Like counters”
But just a normal roblox script can’t do this. You need to connect to something outside of roblox that actually knows the like amount. And you will need to edit the setting on your game that is "Allow HTTP requests or something like that.

2 Likes

Thank you, when I get home I will look into this!

1 Like

You would use HttpService and a proxy endpoint. This can only be done on the server:

local HttpService = game:GetService("HttpService")

local URL = "https://games.roproxy.com/v1/games/votes?universeIds=" .. game.GameId
local Response = HttpService:GetAsync(URL)
local Data = HttpService:JSONDecode(Response).data[1]

local Likes = Data.upVotes
local Dislikes = Data.downVotes
print("Likes:", Likes)
print("Dislikes:", Dislikes)

Note this is just a quick draft, for production use pcall because internet requests fail occasionally. Also enable http requests in your games security settings

game.GameId makes it so it pulls your own games stats, but you can do this with any game if you replace game.GameId with the game id of another game

2 Likes

I tried using roproxy yesterday, but it kept rejecting me. I’ll try again tho

1 Like

Hey, everytime I try this I get HTTP 403 error. Do you know how to fix this? My game has Http requests enabled

I figured it out

local httpService = game:GetService("HttpService")
local data = httpService:GetAsync("https://games.roproxy.com/v1/games/10637961764/votes")
print(httpService:JSONDecode(data).upVotes)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.