Hi, I’m a developer of some games and want to know how to do this:
How can I make a checkpoint that saving player’s position when player leaving the game and when player back to the game again, it returns him to the place he disconnected at?
Will it work if I make a IntValue, that was setting player’s CFrame to it’s value, and after player joining the game and IntValue’s value isn’t 0, it will teleport player to the CFrame that was being on the IntValue’s value?
Each checkpoint (or stored seperately then carried out) a datastore is updated (:SetAsync()) with the checkpoint number being saved
When they join, check the datastore for a value (:GetAsync(), and if it exists then move them to the checkpoint location, else move them to the start
So, does my solution should to work?
Yeah, that’s working! I just created a CFrameValue in workspace and put spawn’s CFrame, and then writed
game.Workspace.GamesVitaliy.HumanoidRootPart.CFrame = workspace.Value.Value
And it teleported me to it!
Guys, how can I save it to the datastore and load it when player joining?
You can do that by writing your CFrame as a string to your datastore and loading it back once they join.
Thanks, I tried to do this already, but that’s doesn’t the solution. It shows this error:
It’s happening because I’m trying to save CFrameValue’s value, that isn’t possible with my save system.
you might have to put a wait in there if it is ran by the server (I think it is)