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

How can i use velocity to push player to the sky?

Asked by 4 years ago
Edited 4 years ago

I create a part, if players touch it, they will be push to the sky but it doesn't work when i set Cancollide = false, how can i fix that ? This is my script

script.Parent.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hum ~= nil then
        script.Parent.Velocity = Vector3.new(0,100,0)
    end
end)

Sorry if it's too confusing, my english is not good

0
Well first off you are making the part go up not the player vortex767 20 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Should be like this because then it make the hit object go upwards hope this helps

script.Parent.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hum ~= nil then
        hit.Velocity = Vector3.new(0,100,0)
    end
end)
Ad

Answer this question