I’ve made this script run once a Player has died and it should be lifting them up as far as i’m aware? but it doesn’t seem to be working (No errors in output)
Script:
local travel = 20
for i = 0, travel do
hit.Parent:FindFirstChild(“HumanoidRootPart”).CFrame = hit.Parent:FindFirstChild(“HumanoidRootPart”).CFrame +Vector3.new(0,1,0)
wait()
First of all, a better aproach to moving the Player’s character model would be to use the :SetPrimaryPartCFrame method of the Model class. Also, you will need to set the Anchored property of the HumanoidRootPart to true.
local travel = 20
local char = hit.Parent
local humanoidRoot = char:FindFirstChild("HumanoidRootPart") --Only do the search for the root part once
humanoidRoot.Anchored = true
for i = 0, travel do
char:SetPrimaryPartCFrame(humanoidRootPart.CFrame + Vector3.new(0,1,0))
wait()
end
I made this concept a while back for a different problem. The coding is a bit more complex than your situation needs, but ill link it here if you need to take a look at an implementation using the TweenService! AnimationWithMotor6D_Transform.rbxl (22.9 KB)