Why Is my Stat Value “ “ (StringValue)

  1. I need my stat value to be starting at “0” But it starts at “ “ - Nothing

  2. My stat value is wrong. It should be “0” Not “ “ Nothing.

  3. I have tried editing my script but nothing worked.

If anyone has any idea what I’m talking about and knows how to fix this the please show me how.

You probably have an empty string saved in your datastore. Try clearing your data once in Studio with RemoveAsync and see if it works.

2 Likes

You have to change instance.new(“StringValue”,folder) to Instance.new(“IntValue”,folder)

I suggest using IntValues rather than StringValues for this case. Strings default to “” where as intvalues default to 0.

Yea, that is what I was trying to explain. You should use Instance.new(“IntValue”,folder) instead of Instance.new(“StringValue”,folder).

You need to check your console for errors and include those in the thread. Unless you’re sure no errors are in your console or the console is unrelated to a problem, don’t post a thread here without first checking your console to know what exactly is happening.

In other news: someone else was using this exact same code on another thread, except their issue was that data wasn’t saving properly. In your case, there’s two problems: both the same problem they were having because the data saving code is poor, and the wrong ValueObject being used.

Please refer to this response for support debugging your code both for the blank value problem (use IntValue, not StringValue) and for the problems you are going to face using that code:

1 Like

Since its a StringValue try to use tostring()