Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a checkpoint and stage counter system?

game.Players.PlayerAdded:Connect(function(Player)
 local Ls = Instance.new('IntValue',Player)
 Ls.Name = 'leaderstats'
 local Level = Instance.new('IntValue',Ls)
 Level.Name = 'Level'
 Level.Value = 1
 Player.CharacterAdded:Connect(function(Character)
  repeat wait() until Character ~= nil
  local Stage = game.Workspace.Stages:FindFirstChild(Level.Value)
  Character:WaitForChild('HumanoidRootPart').CFrame = Stage.CFrame + Vector3.new(0,5,0)
 end)
end)


Will this 2018 code work?

5 comments

0

I don't see why it wouldn't, do you have an error?

1

No, it is just because it is a 2018 script.

0

There are some depreciations in the code though. You can change "connect" to Connect

1

?

1

Oh okay I get it.

1 answer

✓ Accepted answer

Yes that’s exactly how you could do it goodlead.

Here


game.Players.PlayerAdded:Connect(function(Player)
 local Ls = Instance.new('IntValue',Player)
 Ls.Name = 'leaderstats'
 local Level = Instance.new('IntValue',Ls)
 Level.Name = 'Level'
 Level.Value = 1
 Player.CharacterAdded:Connect(function(Character)
  repeat wait() until Character ~= nil
  local Stage = game.Workspace.Stages:FindFirstChild(Level.Value)
  Character:WaitForChild('HumanoidRootPart').CFrame = Stage.CFrame + Vector3.new(0,5,0)
 end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.