✓ Accepted answer
There are some prerequisites to test Data Stores:
- You should test on a server
- You should make sure the games' PlaceId is set.
You can check the second by running the following code in the command bar:
print(game.PlaceId)
If it is 0, you have done something wrong. How to fix? Either close the page and reload your page from the "edit" button (on the roblox site, on one of your places!) OR find out the place id of one of your places (the one you are trying to edit). For example, a place id could be (in your case):
http://www.roblox.com/Bikini-Bottom-Adventure-place?id=21215459
The PlaceId in this case is 21215459
Now, to set the place id, run the following in the place where you are testing the game in Test Server:
game:SetPlaceId(21215459).
Now disable every script and re-enable them. This reloads their code and now Data Stores will work.
3 comments
When I test server, should my character load up or no? because It isn't loading and I don't know if that's a problem or not.
No, it won't load - that's how test server works! :) You basically start a server on how a server runs on roblox. You need to add a player though. Test --> Start Player. You can add as much players as you like! This makes it possible to test things like PVP too!
Cool!