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!
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.
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
local httpService = game:GetService("HttpService")
local data = httpService:GetAsync("https://games.roproxy.com/v1/games/10637961764/votes")
print(httpService:JSONDecode(data).upVotes)