#CHECKPOINT SYSTEN

6 messages · Page 1 of 1 (latest)

harsh mesa
#

i KEEP SPAWNING AT WRONG POINTS

leaden hare
#

ok sad

deep thunder
#

sad

latent topaz
harsh mesa
# latent topaz Show your code???
local checkpoint = script.Parent

checkpoint.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        if not player:FindFirstChild("leaderstats") then
            local leaderstats = Instance.new("Folder")
            leaderstats.Name = "leaderstats"
            leaderstats.Parent = player

            local checkpointStat = Instance.new("IntValue")
            checkpointStat.Name = "Checkpoint"
            checkpointStat.Value = 1
            checkpointStat.Parent = leaderstats
        end

        local checkpointStat = player.leaderstats.Checkpoint
        local checkpointID = checkpoint:FindFirstChild("CheckpointID")

        if checkpointID and checkpointStat.Value ~= checkpointID.Value then
            checkpointStat.Value = checkpointID.Value
        end
    end
end)
leaden hare
#

so sad