Datastore issue

I’m having an issue with pcall function in my datastore script. When player joins the game my script tries to load player’s data, but the pcall returns an error and the game kicks the player (Player gets kicked if pcall returns an error 3 times).

image

I’m aware that this could have a simple solution, but I can’t seem to find anything even though I’m searching for the past hour. Thanks!

:GetAsync() doesn’t error if the key you tried doesn’t exist, it just returns nil. The error is caused by something else. Are you sure that plr and PlrData are both defined?

1 Like

Check if its the right key (30 characters)

I just printed the error and its 502: API Services rejected request with error. HTTP 403 (Forbidden)

You need to turn on API services through the game settings.

I did the moment when i saw the error message and the error is still occurring.

And make your game public, then when you have done both of them, you can run the game again and see what happens.

1 Like

It now works when I made the game public. I would never think of that being the problem. Thanks!

1 Like