Jump to content

[HELP] Largest Player Money


xXGhostXx

Recommended Posts

That actually makes a difference.. Well for elementData you could do that:

 

funciton getRichestPlayer()
	local tblPlayersMoney = {};

	for _, player in pairs(getElementsByType("player")) do
  		table.insert(tblPlayerMoney, {player = getPlayerName(player), money = getElementData(player, "money")});
  	end

	table.sort(tblPlayersMoney, function (a, b) return a.money > b.money end);

	for i, v in pairs(tblPlayersMoney) do
  		outputChatbox("Place " .. i .. " is " .. v.player .. " with " .. v.money .. "$", 255, 255, 255, true);
  	end
end

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...