Money System: Overwriting Unwanted Values!!

I will try and explain this as best as possible so I have created a money system, very simple when a player joins it checks if they have money if not create a file to store there money, currently money can be added and taken. There is two money forms currently, the Bank file and the Direct file( the money stored “on your player”);(HUD display show bank on top and direct on bottom) that all works great and everything saves like a charm untill it comes to joining and I can’t figure out the issue, when joining one of the account will be overwritten with a 0 or just nothing, and it started with the bank file but then they swapped and I retraced my steps when this happened but I basically changed nothing. If you would like to take a look at the code go HERE, the only other pieces of code not displayed are the commands, hud, and firstjoin check.

thanks to anyone in advance!

If the issue you are having happens when joining you might want to display the first join check as it’s most likely related to this part of your code.

Best way to deal with stuff like this is to debug, adding print() in a lot of places and then seeing at which step the problem occurs. Also I would suggest PData for storage, better than txt file and more reliable.

I have already tried doing the print thing and the problem originates from the read function where it just randomly decides to overwrite the old value, and I’ll try that PData.

[editline]27th February 2015[/editline]

by display meaning as so you can see it there is a link to a pastebin

also decided I’m going to stick with txt files just because I want to be able to edit peoples account out side the game :slight_smile: