So I just recently made an XP Bar and it’s great and all but when it comes to leveling up it gets kinda weird, i’m using a click detector right now to just test and I try to add 1k xp and it does this to it
So basically, I want to access my playerdata throughout every single server script so I pair it with _G so I can retrieve, modify the data anywhere I want too! Plus it makes it so much easier to save data when its all organized like so
Except the while loop has a conditional statement that must be meet for it to run. So it’s not continuously adding experience. I think it would be obvious to spot if that was the issue.
I’ve never used _G before since I’ve heard it has negatives to it that in many cases out weigh the positives so I was just curious why you (@loveicicIe ) are using _G over storing player’s data in ModuleScripts. Since I thought a big positive of using ModuleScripts is you could create functions to award player experience instead of using a constant loop.
Basically Im not a big fan of storing data in actual objects in explorer so, I tied _G to a table called PlayerData and I can use it across all server scripts where I need to use them, this makes datastores much easier for this kind of structure