#Checkpoint bug

28 messages · Page 1 of 1 (latest)

clever sentinel
#

heres the code: ```lua
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)```

#

its not working sometimes and pretty glitchy

#

if you know whats wrong, pls help me

clever sentinel
#

why not use the default one

clever sentinel
#

i figured it out tho

#

i forgot to makr as solved

clever sentinel
clever sentinel
#

they dont work for this situation

clever sentinel
#

yes ik

#

yes i know i alr read that

clever sentinel
#

it has to be a checkpoint

#

not a spawn location

#

there is 0 difference between those two

#

yes there is

#

a spawn location is where u spawn

#

a checkpoint is where u respawn if u die

#

but checkpoints are activated by touch

#

you realise you spawn into spawnlocations if you die right?

#

oop-

#

well nnvm its fine

#

:D

#

I dont really care what you use I just wanted to see why you are makin yourself suffer