Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you make a checkpoint and stage counter system?

Asked by
goodlead -62
4 years ago
Edited 4 years ago
01game.Players.PlayerAdded:Connect(function(Player)
02 local Ls = Instance.new('IntValue',Player)
03 Ls.Name = 'leaderstats'
04 local Level = Instance.new('IntValue',Ls)
05 Level.Name = 'Level'
06 Level.Value = 1
07 Player.CharacterAdded:Connect(function(Character)
08  repeat wait() until Character ~= nil
09  local Stage = game.Workspace.Stages:FindFirstChild(Level.Value)
10  Character:WaitForChild('HumanoidRootPart').CFrame = Stage.CFrame + Vector3.new(0,5,0)
11 end)
12end)

Will this 2018 code work?

0
I don't see why it wouldn't, do you have an error? TaxesArentAwesome 514 — 4y
1
No, it is just because it is a 2018 script. goodlead -62 — 4y
0
There are some depreciations in the code though. You can change "connect" to Connect DarkDanny04 407 — 4y
1
? goodlead -62 — 4y
1
Oh okay I get it. goodlead -62 — 4y

1 answer

Log in to vote
0
Answered by
iivSnooxy 248 Moderation Voter
4 years ago

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

Here

01game.Players.PlayerAdded:Connect(function(Player)
02 local Ls = Instance.new('IntValue',Player)
03 Ls.Name = 'leaderstats'
04 local Level = Instance.new('IntValue',Ls)
05 Level.Name = 'Level'
06 Level.Value = 1
07 Player.CharacterAdded:Connect(function(Character)
08  repeat wait() until Character ~= nil
09  local Stage = game.Workspace.Stages:FindFirstChild(Level.Value)
10  Character:WaitForChild('HumanoidRootPart').CFrame = Stage.CFrame + Vector3.new(0,5,0)
11 end)
12end)
Ad

Answer this question