These are the codes:
function Change()
_G.Checkpoint = script.Parent
end
script.Parent.Touched:connect(Change)
Next one:
function onPlayerEntered(newPlayer)
newPlayer:WaitForChild("Torso").CFrame = _G.Checkpoint.CFrame
end
game.Players.ChildAdded:connect(onPlayerEntered)
function onPlayerRespawned(newPlayer)
h = newPlayer:WaitForChild("Torso")
if h ~= nil then
h.CFrame = _G.Checkpoint.CFrame
end
end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
I'm trying to make a non-leaderstat checkpoint system, like if I were to just copy the same block over and over, the checkpoints would still work.
Errors:
Workspace.Script:9: Attempt to index field "Checkpoint" (a nil value)

1 comment
Yay it works!