Code:
banana = script.Parent
function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Parent = hit.Parent.UpperTorso
bv.Velocity = hit.Parent.UpperTorso.Velocity.unit*-50
wait(0.8)
bv:Destroy()
end
end
banana.Touched:connect(onTouch)
In this script I tried to make a knockback effect once the player touches this script's parent. The problem is, if the player, by some miracle, stands on the part one of these three things happen:
The knock back does its job and knocks the player up, the knock back drags the player to the ground until bv gets destroyed, or it kills the player instantly. I don't know how to fix this, somebody please help.

1 comment
A gif of what is happening would also be helpful if this issue persists