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

Can the SaveNumber method save "0"?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

I've been working on this prison system and use Data Persistence to save the amount of seconds they still have left. I've noticed when the value is 0, it prints 'save', but when I load it after rejoining, it appears it never saved at all. First script is the Saving one; Second is loading.

*Script Removed

1
It should be able to save 0. How are you testing this? In an actual published place? Are you sure `pris.value` is actually being changed how you think it is? (Maybe that should be part of your print statement) BlueTaslem 18071 — 9y
0
BlueTaslem, I had the same problem at one of my Training Facilities saving Promotion Points, and I had to save the number as -1 then have the script recognize it as 0 when a person entered. M39a9am3R 3210 — 9y
0
@Blue and M3, Thanks for input. Shawnyg 4330 — 9y

1 answer

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
9 years ago

I am assuming ROBLOX just wants to save data and Data Persistence requests by doing this, but they don't save the number 0. The best thing you could probably do is save the number as a -1 and when the player rejoins have the script load their jail time as 0 seconds.

Ad

Answer this question