Not sure if this is the correct category but I didn’t know which one. Anyways, If anyone here is familiar with the game “Aquatic Pools” I am looking for their tip system. I know it’s out there somewhere because I see SO many other games with it! If anyone knows what it’s called please let me know!
1 Like
Hey hey! So sorry for being late! I hope I can still help with the problem. The way Aquatic Pools and most RP games does tipping is the same way that PLS Donate and a lot of other donation games, such as my (not so proud) donation game lol. I’ll give you code snipplets from my game since it’s a ghost town.
- Use HTTPS and RoProxy to fetch all of a user’s games.
Here’s a snippet for anyone who also needs this for future references (this is in my PlayerProductModule):
function PlayerProductModule:GetUserGames(playerUserID)
local BaseEndpoint = "https://games.roproxy.com/v2/users/%d/games?limit=50&sortOrder=Asc"
local FormattedEndPoint = BaseEndpoint:format(playerUserID)
local Success, Data = pcall(function()
return httpService:GetAsync(FormattedEndPoint)
end)
if Success and Data then
local decodedData = httpService:JSONDecode(Data)
return decodedData['data']
end
end
- Congrats! Now you have a list of user’s games! Now you should loop through it and fetch all the gamepasses!
Here’s how to do it:
function PlayerProductModule:GetGameGamepasses(UniverseID)
local gamepassesList = {}
local function fetchGamepasses(cursor)
local url = "https://games.roproxy.com/v1/games/" .. UniverseID .. "/game-passes?sortOrder=Asc&limit=100"
if cursor then
url = url .. "&cursor=" .. cursor
end
local success, data = pcall(function()
return httpService:GetAsync(url)
end)
if success and data then
local decodedData = httpService:JSONDecode(data)
if decodedData and decodedData["data"] then
for _, gamepass in ipairs(decodedData["data"]) do
if gamepass.sellerId then
table.insert(gamepassesList, gamepass)
end
end
if decodedData["nextPageCursor"] then
fetchGamepasses(decodedData["nextPageCursor"])
end
end
else
warn("Failed to retrieve gamepasses from URL: " .. url)
end
end
fetchGamepasses(nil)
return gamepassesList
end
- This is pretty hastily made so there’s probably ways to make it more efficient. Under each player, you should attach a folder called “tip game passes” or whatever, under that, each game pass can be represented by a game pass Id and price under a config. When a user clicks the gui, it loops through all the players and whoever has a game pass folder it displays it in the gui. When the user presses tip, it loads in all the game pass configs with their price and game pass id, if a player presses that game pass and it prompts them to buy the game pass.
- On the serverside, attach a listener to a game pass prompt finish (whatever it is called), make sure it was purchased (wasPurchased == true), loop through all players who has a game pass folder (or through a list of players with the list of game passes that was loaded in) and check the purchased game pass id with each of the id, once you find it, you now have the amount and person who donated and the person who received it, do with that however you want.
[Note] If you want a more in-depth explanation or walk through, don’t hesitate to reply to this message saying so!
Hi! Sorry for the late response too haha! Thanks so much! I’ll be sure to use this!