How do I make people get money in 30 seconds which is not in the leaderboard. Thanks if you help me
It's best to just store variables in the script instead of instancing a class and replicating it all over the place letting people hack it.
01 | local money = { } |
02 | game.Players.PlayerAdded:connect( function (player) |
03 | money [ player.Name ] = 0 |
04 | end ) |
05 |
06 | while wait( 30 ) do |
07 | for i,v in pairs (money) do |
08 | money [ i ] = money [ i ] + 100 |
09 | end |
10 | end |
Same as leaderstats, though don't name the Holder "leaderstats".
If you want to store custom player attributes outside of the leaderboard, you could do it in several ways.
The simplest would be a lua table with the username or userID + an identifier (ex "Player1_money") and the value as the value...
If you need to access in multiple scripts, you could use the same approach as leaderstats, except don't name it leaderstats.
1 | game (DataModel) |
2 | Players (Player Service) |
3 | Player 1 (Player) |
4 | CustomAttributes (BooleanValue) |
5 | money (IntValue) |
Or, if you want to persist it over game plays, you could use Data Persistence/ DataStore.