Ad
Log in to vote
0

How do I make people get money NOT in leaderboard

Asked by
xAtom_ik 575 Moderation Voter
7 years ago

How do I make people get money in 30 seconds which is not in the leaderboard. Thanks if you help me

3 answers

Log in to vote
2
Answered by
1waffle1 2898 Trusted Badge of Merit Moderation Voter Community Moderator
7 years ago

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
0
Mistake! for i,v in pairs(money) needs to change to: for i,v in pairs(money) do xAtom_ik 575 — 7y
Ad
Log in to vote
0
Answered by
Muoshuu 583 Moderation Voter
7 years ago

Same as leaderstats, though don't name the Holder "leaderstats".

Log in to vote
0
Answered by
Bubby4j 231 Moderation Voter
7 years ago

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.

0
I don't understand xAtom_ik 575 — 7y
0
What part don't you understand? Bubby4j 231 — 7y
0
The script xAtom_ik 575 — 7y
0
It's not a script, It's showing what the explorer would look like. Bubby4j 231 — 7y

Answer this question