Jump to content

[QUESTION]Money For Scoreboard


Recommended Posts

Posted

-- server side:

exports [ "scoreboard" ]:addScoreboardColumn ( "Money", 3 ) -- Add the "Money" column to the scoreboard. 
  
function updatePlayersMoney ( ) -- Create "updatePlayersMoney" function. 
    for index, player in ipairs ( getElementsByType "player" ) do -- Loop through all online players. 
        setElementData ( player, "Money", getPlayerMoney ( player ) ) -- Set "Money" element data to the player money. 
    end -- End our loop. 
end -- End our function. 
setTimer ( updatePlayersMoney, 2500, 0 ) -- Set a infinite 2.5 seconds timer to execute "updatePlayersMoney" function. 

Posted
i have one more question to solid.

does this work when a player wins a race he gets money like 340 or 1000?

Why not try?

But to answer your questions, yes it should.

It takes the players money, and updates is every 2.5 seconds.

Posted
i have one more question to solid.

does this work when a player wins a race he gets money like 340 or 1000?

The money will update as long as your script uses the default money system.

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...