I've tried to make my own, I've tried to use models but none work. The same problem I encounter every time is:

A) The leaderboard (top right) never shows what stage the player is currently on

B) I spawn at random checkpoints on a consistent basis

C) Sometimes the checkpoint just straight up doesn't work

D) Sometimes on working checkpoints, the avatar switches stages after death because of a body part hitting it.

Sorry for so many problems. Thanks so much for reading this/answering! -Ieprichaun

I've been receiving negative votes, so here's the closest I got to a working script:

Checkpoint Script: local spawn = script.Parent spawn.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local checkpointData = game.ServerStorage:FindFirstChild("CheckpointData") if not checkpointData then checkpointData = Instance.new("Model", game.ServerStorage) checkpointData.Name = "CheckpointData" end

    local checkpoint = checkpointData:FindFirstChild(tostring(player.userId))
    if not checkpoint then
        checkpoint = Instance.new("ObjectValue", checkpointData)
        checkpoint.Name = tostring(player.userId)
       
        player.CharacterAdded:connect(function(character)
            wait()
            character:WaitForChild("HumanoidRootPart").CFrame = game.ServerStorage.CheckpointData[tostring(player.userId)].Value.CFrame + Vector3.new(0, 4, 0)
        end)
    end
   
    checkpoint.Value = spawn
end

end)

2 comments

0

The parent argument to Instance.new() is deprecated. Assign the parent last for better performance results. userId and connect are deprecated, use UserId and Connect

0

I'm sorry, I don't understand... I'm new to scripting