I’ve noticed that many big games have a feature where they reward players for liking the game. I’m curious about how to implement such a feature myself. Would I require a proxy or something similar for this to work and how?
Pretty sure this is against ToS and just straight up impossible, though I’ve seen games bluff into making players like the game. They say something like “Join the group and like the game to get a reward!” and end up only checking if you joined the group, hoping that you had to at least join the group so you probably liked the game too.
You would, you would just require the UniverseId of your game (game.GameId
), and then gather the data given from the Request, example topic here:
No, there arent any rules against proxies, or HTTP Requests for roblox, the only reason roblox doesnt allow it natively is for security, which they are planning to allow for certain domains to be accessible to the service.
Let me know if you find anything that nullifies this.
However, it would be much simpler to check if they are in a group using Player:IsInGroup()
, as compared to gathering the players whole list of favorites, not to mention the HTTP Request can take a couple of seconds to return any data.
You would indeed need a proxy.
The flaw with this method is that the Request for the vote status of a user is only available to the authenticated user, hence you can’t just check a user’s vote status by their user id or something like that. Needless to say, you cannot make a request on the behalf of their user authenticated as them.
The only viable approach here I see is checking amount of upvotes for a game before and after the user tries to claim the reward, but this is obviously useless, and will never work well.
Thank you for your response and willingness to help out. We’re currently working on implementing a feature in our game where players are rewarded if they like the game. We’ve been attempting to check whether players have liked the game by making HTTP requests to retrieve data about game votes.
Our approach involves using the UniverseId of our game (game.GameId
) to gather data from the request and determine if a player has liked the game. However, we’ve encountered difficulties with parsing the JSON response from the API endpoint. Instead of receiving the expected JSON data, the response appears to be an HTML page.
Here’s a simplified version of our current script:
-- Reference to ServerStorage
local serverStorage = game:GetService("ServerStorage")
-- Reference to the ProximityPrompt
local proximityPrompt = script.Parent.ProximityPrompt
-- Function to check if the player has liked the game
local function checkLikeStatus(player)
local liked = false
local success, response = pcall(function()
return game:GetService("HttpService"):GetAsync("https://games.rprxy.xyz/v1/games/votes?universeIds=" .. game.GameId)
end)
if success then
-- Modify the response to remove trailing commas
response = response:gsub(",%s*%}", "}")
-- Change { and } to [ and ] respectively
response = "[" .. response:gsub("{", "["):gsub("}", "]") .. "]"
print("JSON Response:", response)
local data = game:GetService("HttpService"):JSONDecode(response)
if data and data[1] and data[1].data and data[1].data.upVotes then
liked = true
end
else
print("Error retrieving data:", response)
end
return liked
end
-- Function to handle when the ProximityPrompt is triggered
local function onPromptTriggered(player)
if checkLikeStatus(player) then
-- Give the player the tool if they liked the game
local tool = serverStorage:FindFirstChild("Test")
if tool then
tool:Clone().Parent = player.Backpack
print(player.Name .. " has received the tool.")
end
else
-- Notify the player if they haven't liked the game
print(player.Name .. " has not received the tool. Please like the game.")
end
end
-- Connect the ProximityPrompt's trigger event to the handler function
proximityPrompt.Triggered:Connect(onPromptTriggered)
We would greatly appreciate any insights or suggestions you might have to help us resolve this issue and achieve our goal of rewarding players for liking the game.