How would I make a one-time payout on join?

So I am trying to update a player’s leaderstat value when they join the game, but only on 1 time that they join (it only updates the first time they join an updated server, then never updates in the future when they rejoin).

If anyone knows how to make this work, please let me know.

If you have any datastore you can check if that is above the starting number when they join, and then use that to give them their money if it is at the starting number.

1 Like

You could save it in a Datastore. If you used a BoolValue saying that player received the payout and set it to true then just test if the value is true and if not/doesn’t exist then give try em the payout.

You could also do it @arrowman888 method, the only issue is if the value you’re paying out can go under the original payout value then it would be wrong. You’re able to do something like:
money.Value = Datastore:GetAsync(stuff) or 50
50 would be that original payout for example.

I see now, and that’s what I hd originally thought, but I just wanted to see what other people had to say. Thanks.

Ya either would work, I just haven’t done much with Datastores recently so the second bit is possibly wrong. I know the concept but not the code. Good luck.

Yep, I just tried it, and it worked. For some reason, last time I tried using DataStore with boolvalues, it didn’t work, but it seems to be now. Thanks again to you and @arrowman888

1 Like