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

How to move a player up slowly with CFrame?

Asked by 5 years ago

How would I add onto this code to make it so it would move the player up slowly instead all at once.

for i, player in ipairs(game.Players:GetChildren()) do

player.Character.HumanoidRootPart.CFrame = CFrame.new(0,100,0)

1 answer

Log in to vote
0
Answered by 5 years ago
for i, player in ipairs(game.Players:GetPlayers()) do -- use GetPlayers()
    for j = 1, 20 do
        wait(0.5)
        player.Character.HumanoidRootPart.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position + Vector3.new(0, 0.5, 0))
    end
end

If I'm not mistaken, this is what you should be looking for.

0
Yeah that's what I was looking for. How would you counter the gravity whilst moving up? dracefiery 4 — 5y
0
lower the gravity DeceptiveCaster 3761 — 5y
0
Thanks for the help, also the way you sent makes it look really choppy, anyway around this? I already tried lowering the numbers. dracefiery 4 — 5y
View all comments (2 more)
0
try messing around with the increment and wait times. I would also recommend using SetPrimaryPartCFrame rather than directly modifying the cframe of the HRP theking48989987 2147 — 5y
0
I switched over to BodyVelocity, which seems to work better. dracefiery 4 — 5y
Ad

Answer this question