Hi, I am trying to cobble together a script which will exist in the workspace that will help relocate players to a previous checkpoint from a value stored in the DataStore which is then mapped to a value on the character when they load in.
Please note, I'm still only at the 'google and copy/paste' stage of coding but the patience and kindness of this community is making that process a lot less reliant on other existing solutions.
So far I think I have something that would read the value stored on the character and once I can use that value to locate the model I want to MoveTo I think it would do the teleportation for me... please feel free to rip me a new one and provide any teaching moments you can.
The code starts with an overview of the folder structure in place to help you understand what I am trying to access.
--Workspace
----checkPoints
------1-25. lava
--------1
--------2
--------etc
------26-50. cloud
--------26
--------27
--------etc
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local progress = char.leaderstats.Stage.Value
local checkpoint = ???HELP HERE???
char:MoveTo(checkpoint.Position + Vector3.new(0,3,0))
if char:findFirstChild("ForceField") then
char.ForceField:Destroy()
end
end)
end)
Thanks for any help.

4 comments
Sorry, I thought I had made it clear but in my attempt to do so likely made it more convoluted! Yes, checkpoint refers to a model named 1, 2, 3 etc... within that model is a part with a matching name so it is that I'm trying to locate, my issue is matching the players Stage Value to the list of checkpoints rather than a specific one... if that makes sense, sorry if not!
oh, ok, just make that part the PrimaryPart
Thanks, and please pardon my ignorance, with that in mind how would I go about setting the correct checkpoints primary part as the 'checkpoint' variable, I presume I need to index the core folders dependents or something?
not really, the part should be a child of the Model not a descendant