So when a toss part touches a player its supposed to lightly fling them. But for some reason at random, instead of setting linearvelocity to a certain number, it adds to it instead (what i assume is happening) Heres the code and video of the problem:
local ball = script.Parent
local cd = false
ball.Touched:Connect(function(h)
if cd == false then
local flingcount = 0
if h then
if h.Parent then
if h.Parent:FindFirstChild("HumanoidRootPart") then
cd = true
repeat
flingcount += 1
local hrp = h.Parent:FindFirstChild("HumanoidRootPart")
h.Parent.Humanoid.Sit = true
hrp.AssemblyLinearVelocity += Vector3.new(0, 10, 0)
hrp.AssemblyAngularVelocity = Vector3.new(0, 50, 50)
until flingcount == 1
end
end
end
flingcount = 0
wait(0.5)
cd = false
end
end)
How would I fix this?