There isn’t an issue with the script (i.e nothing here needs to be replicated, it is all handled on the server) - he was setting the values from the client’s end due to a lack of understanding of client and server disconnect.
OP, if you want an improved data system, I highly recommend DataStore2 by @Kampfkarren.