Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SpawnLocation = script.Parent
- local player
- SpawnLocation.Touched:Connect(function(hit)
- if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(hit.Parent.Name):FindFirstChild("leaderstats") and game.Players:FindFirstChild(hit.Parent.Name).leaderstats.Stage.Value ~= 1 then
- player = game.Players:FindFirstChild(hit.Parent.Name)
- local Stage = player.leaderstats:WaitForChild("Stage").Value
- local Checkpoint = SpawnLocation.Parent:WaitForChild("Checkpoint"..Stage)
- hit.Parent:WaitForChild("HumanoidRootPart").CFrame = Checkpoint.CFrame + Vector3.new(0,3,0)
- print(player.Name.." Was Teleported to Checkpoint"..player.leaderstats.Stage.Value)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement