Cant get a players data folder

So i have this script that is
Player.Data.oName.Value = “test”

And that correlates correctly to what i have but it comes out with this error
image

Try checking if the data instance is actually in the player in the explorer. Or you could put this line before that one and see if the value exist:

print(Player:FindFirstChild("Data"))
1 Like

Do you attempt to index it with instance[....] or :FindFirstChild()?
As the folder might not have been loaded while that script line was running.
I suggest doing:

player:WaitForChild("Data", math.huge) -- // Will wait for the folder to be created and the math.huge is for excluding the timeout.
1 Like

You don’t even need to use math.huge. The timeout parameter is optional and if it isn’t included then it will never timeout. The timeout parameter is only if you want it to timeout after a certain amount of time.

2 Likes