How do I make people get money in 30 seconds which is not in the leaderboard. Thanks if you help me
How do I make people get money NOT in leaderboard
3 answers
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.
local money={}
game.Players.PlayerAdded:connect(function(player)
money[player.Name]=0
end)
while wait(30)do
for i,v in pairs(money)do
money[i]=money[i]+100
end
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.
game (DataModel)
Players (Player Service)
Player1 (Player)
CustomAttributes (BooleanValue)
money (IntValue)
Or, if you want to persist it over game plays, you could use Data Persistence/ DataStore.
4 comments
I don't understand
What part don't you understand?
The script
It's not a script, It's showing what the explorer would look like.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Mistake! for i,v in pairs(money) needs to change to: for i,v in pairs(money) do