1 | game.Players.PlayerAdded:connect( function (p) |
2 | p:WaitForDataReady() |
3 | if p:LoadInstance() = = nil then |
4 | game.ReplicatedStorage.CreateAToon.Rooms:Clone().Parent = game.Workspace |
5 | end ) |
6 | end |
what it should do is check p which is the player for any save instances then if there is none represented by nil, it should spawn a create room. But it does nothing at all except give me some errors in dev console. Errors Link: http://prntscr.com/brmv15 http://prntscr.com/brmvou
You are missing a closing bracket for the connect
function. It should look like this:
1 | game.Players.PlayerAdded:connect( function (p) |
2 | p:WaitForDataReady() |
3 | if p:LoadInstance() = = nil then |
4 | game.ReplicatedStorage.CreateAToon.Rooms:Clone().Parent = game.Workspace |
5 | end |
6 | end ) |
Another thing I noticed is that you are not passing anything to LoadInstance
, when you should be passing the key for what you're trying to load.
Finally, you should probably use Data Stores, rather than data persistence, however these are a bit more complicated.