Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Request started.");
- local info = game:GetService("HttpService"):JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/'..game.GameId..'/game-passes?sortOrder=Asc&limit=50'))
- local gpids = {}
- local total = 0;
- for i,v in pairs(info.data) do
- if v.price then
- table.insert(gpids,v.id)
- end
- end
- print("Got gamepass ids");
- function commas(number)
- local i, j, minus, int, fraction = tostring(number):find('([-]?)(%d+)([.]?%d*)')
- int = int:reverse():gsub("(%d%d%d)", "%1,")
- local s = minus .. int:reverse():gsub("^,", "") .. fraction
- s = string.split(s,'.')[1];
- return s;
- end
- for i,v in pairs(gpids) do
- local req = game:GetService("HttpService"):JSONDecode(game:HttpGet('https://api.roblox.com/marketplace/game-pass-product-info?gamePassId='..v));
- local sales = req.Sales;
- local price = req.PriceInRobux;
- price = math.floor(price * .70);
- local amount = price * sales;
- total = total + amount;
- end
- print("Totalled")
- total = math.floor(total);
- messagebox('Calculated Revenue:'..'\n'..'Robux: '..commas(total)..'\n'..'USD: '..commas(total/100000*350),'Notification:',0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement