Is there any way to check if a player has joined before trying to save data to DataStore2?

Hello,

My current admin panel system for my game does not do a check if a player has joined the game before. The problem is, I can’t figure out where I would figure out how to do any of this. Currently, if you try to modify the data of a player who has never joined the game before, my script will return an attempt to index nil error. I’m familiar with DataStore2 and normal DataStores. I just have no clue how to approach this. Then again, I’m currently trying to do this at 5 AM so I’m completely zoned out, so that might be a contributing factor.

Thanks,
pos0.

Alright, all you have to do is try to get the data of the player using DataStore2. If it isn’t nil, return data. If the function returns nil, then return false and don’t modify PlayerData.