Assuming that you have a leaderstats already setup and a folder called 'Stages' to store the stage. Create a part at the bottom of all the stages, so when the player falls, they will hit the part. Copy paste this script into said part.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid").Health > 0 then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
local HumanoidRootPart = hit.Parent:FindFirstChild("HumanoidRootPart")
if Player and HumanoidRootPart then
local leaderstats = Player:FindFirstChild("leaderstats")
HumanoidRootPart.CFrame = game.Workspace.Stages:FindFirstChild(leaderstats.Stage.Value).CFrame
end
end
end)
Hope this helps and remember to accept it it did! If there is an error, report it to me and I will try my best to fix it asap!
1 comment
please follow https://scriptinghelpers.org/help/how-post-good-questions-answers