How much PData is too much PData?

I searched around for a bit. Couldn’t really find anything except for this one thread posted back in 2012 or something. Pretty much said that PData was very resourceful.

I’m making a gamemode for a bit of fun and it seems I can’t save the user’s guns that they bought. I messed around with this for days thinking it might be a mistake I made. Though I can’t see any errors.

So just to be sure, I wanted to ask if the amount of PData I have saved to each user here is too much. My guess is it might not be saving the data because it runs through ALL of the PData variables and sets them every time the server shuts down or user disconnects.
Maybe it can’t run through all of it time?

I don’t know guys. I’m stuck here. :confused:
Sorry if this is one of those dumb questions.

Here is the shared player meta-table-script-whatever that has all the code inside.

Considering PData simple saves it into SQLite as a string, stuff like on line 87

self:GetPData( gunToCheck..".SavedUnlocked" ) == 1

will always fail.

You can’t really have too much PData, considering it’s all stored in SQLite, there’s a limit, but you probably won’t hit it. As for it being efficient, you can almost always create a better scheme than what PData uses. Whether it’ll matter depends on what it is.

I recommend making your own SQLite tables

gunToCheck is a string. I did something similar later in the file, on line 168. So it’s still valid. Thanks for the extra info though. Now I know its an issue on my behalf. :slight_smile:

That’s not what I mean, PData saves the data you give it in string form, so

Player:GetPData will always return a string. Because of that the comparison will always fail.

Facepalming right now. Didn’t see that. Thank you so much lol. Sorry for the misinterpretation. Have a good one man. :slight_smile: