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

What is the best way to make a player hover over a block?

Asked by 6 years ago

Okay, so I'm trying to create a flood type disaster, and I want the players in the water to move ontop of the rising flood.

I tried doing something like this

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        hit.Parent.Torso.Velocity = Vector3.new(0, hit.Parent.Torso.Velocity.Y+10, 0) 
    end
end)

or something like this

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        hit.Parent.Torso.CFrame = CFrame.new(hit.Parent.Torso.CFrame.X,hit.Parent.Torso.CFrame.Y + 10, hit.Parent.Torso.CFrame.Z) 
    wait()
    end
end)

but it doesn't seem to work. Should I achieve this by using bodypositions?

Answer this question