Is it possible to know how many robux is on the player's account using script?

so if its possible to know a player’s account age using script. I’m wondering if you can know their robux ammount or how many place they visited using script

2 Likes

image
i’m talking about this

2 Likes

You can’t check the amount of Robux in another user’s account, and I don’t believe Roblox offers an API to check how many visits a player has.

3 Likes

I know one game that uses API for getting place visits and player age. But I do not know how.
Game: Flex Your Account Ageˢ 🔊 - Roblox

2 Likes

yeah i know this but i’m curious if its possible to know the placevisits and robux ammount ingame

2 Likes

https://games.roblox.com/docs#!/Games/get_v2_users_userId_games there is one api but i don’t know how to add it ingame

1 Like

I don’t have a clue on how to do this. Im guessing it requires the use of the HTTP service. Good luck!

2 Likes

You could use a proxy with HttpService to make calls to that url and the universe API. Once you have each place’s visits, just add them all up and voila.

3 Likes

Robux count is private and inaccessible. Most likely for privacy reasons and preferably kept hidden forever.

Place visits however has an already made topic: Is there a web api to get place visits or currently playing? - #4 by H_mzah. Search before you post.

4 Likes

Since a solution for this was never really provided I decided to write one, here you go.

local players = game:GetService("Players")
local http = game:GetService("HttpService")
local get = http.GetAsync
local jsonDecode = http.JSONDecode
local groups = game:GetService("GroupService")
local getGroups = groups.GetGroupsAsync

local proxyUrl = "roproxy.com"
local baseUrl = "https://games."..proxyUrl.."/v2/%s/%d/games?sortOrder=Asc&limit=50&cursor=%s"

local function getPlaceVisitsRecursive(context, targetId, cursor, placeVisits)
	cursor = cursor or ""
	placeVisits = placeVisits or 0
	
	local requestUrl = string.format(baseUrl, context, targetId, cursor)
	local success, result = pcall(get, http, requestUrl)
	if success then
		if result then
			local success2, result2 = pcall(jsonDecode, http, result)
			if success2 then
				if result2 then
					for _, placeItem in ipairs(result2.data) do
						placeVisits += placeItem.placeVisits
					end
					
					cursor = result2.nextPageCursor
					if cursor then
						return getPlaceVisitsRecursive(context, targetId, cursor, placeVisits)
					else
						return placeVisits
					end
				end
			else
				warn(result2)
			end
		end
	else
		warn(result)
	end
	task.wait(1)
	return getPlaceVisitsRecursive(context, targetId, cursor, placeVisits)
end

local function getOwnedGroups(userId)
	local ownedGroups = {}
	local success, result = pcall(getGroups, groups, userId)
	if success then
		if result then
			for _, groupItem in ipairs(result) do
				if groupItem.Rank == 255 then
					table.insert(ownedGroups, groupItem)
				end
			end
		end
	else
		warn(result)
	end
	return ownedGroups
end

local function onPlayerAdded(player)
	local placeVisits = getPlaceVisitsRecursive("users", player.UserId)
	local ownedGroups = getOwnedGroups(player.UserId)
	for _, ownedGroup in ipairs(ownedGroups) do
		placeVisits += getPlaceVisitsRecursive("groups", ownedGroup.Id)
	end
	print(placeVisits)
end

players.PlayerAdded:Connect(onPlayerAdded)

This will parse through the information regarding a user’s games, the groups they own and those group’s games, calculating the place visit total of an entire account.

2 Likes

I believe that Game.players.localplayer has a property of player.accountage. I have a script in one of my games that has a textlabel displaying account age.