Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I set my leaderstats to 0?

Asked by 5 years ago
Edited 5 years ago

So i was creating a clicker game and i was setting up the auto save system. When i set it up i somehow messed something up and it gave me a bunch of Strength (my leaderboard stat). When I go to Player > (my user) > leaderstats > Strength and type the Value to 0, it just went back to the big number. Please tell me how I can reset my Strength leaderstat to 0.

``game.Players.ThatGuyYouMetOneDay.leaderstats.Strength.Value(0)

I'm really sorry i don't know how to import the code. Please don't get mad at me!!

I use this code in a normal script, not sure if i'm supposed to put it in local or module. Please help and i'm sorry if this is a very bad representation of this coding language and site.

0
Edit your question, add your script, then save CjayPlyz 643 — 5y
0
Did it, i'm not sure how to import script because i am new to this site, please don't be mad at me D: ThatGuyYouMetOneDay 2 — 5y
0
Don't worry, everyone has been new here ;D BTW answered to your question! MiguRB 60 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Hello,

Simply try to use this script instead.

game.Players.ThatGuyYouMetOneDay.leaderstats.Strength.Value = 0

If this still does not work, try going into F9, (the developer console) and insert the script there instead. Make sure you have Enable Studio Access to API Services on. This should work.

You should also make sure that your datastore script is working, so it can save the new stats for your character. If none of this works, you can always make a new datastore called something else. This should obviously reset all player's stats.

Please accept my answer if this helped you out. Simon.

Ad
Log in to vote
0
Answered by
MiguRB 60
5 years ago

To change values of anything you need to use the equal '=' mark. So instead write this:

game.Players.ThatGuyYouMetOneDay.leaderstats.Strength.Value = 0

And I saw your comment, to make a script line like this one, you can see some icons and letters on top of your writing area. Clicking there, you can change your text style to Bold, Italic, Links, and lines of code

0
Thank you! ThatGuyYouMetOneDay 2 — 5y

Answer this question