game.Players.PlayerAdded:connect(function(p) p:WaitForDataReady() if p:LoadInstance() == nil then game.ReplicatedStorage.CreateAToon.Rooms:Clone().Parent = game.Workspace end) 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:
game.Players.PlayerAdded:connect(function(p) p:WaitForDataReady() if p:LoadInstance() == nil then game.ReplicatedStorage.CreateAToon.Rooms:Clone().Parent = game.Workspace end 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.