I saw people using forces to push/fling, so I tried this.
local y = Instance.new("BodyVelocity") y.maxForce = Vector3.new(math.huge, math.huge, math.huge) y.Velocity = humanoid.Parent.HumanoidRootPart.CFrame.lookVector * -9000 y.Parent = humanoid.Parent.HumanoidRootPart game.Debris:AddItem(y,1)
So what i'm doing is putting a body force in humanoid root part, and this only happens if they touch a tornado (spell) for each person. I tried making the value as high/low as I could and nothing happens. So what actually happens is that they take damage from my tornado, but they don't get flinged. How do I make them get pushed back/flinged? I'm confused and please help thx. Note: The humanoid is from the touched function: .Touched:Connect(function(part), part.Parent:FindFirstChild("Humanoid").
BodyForces are deprecated. I'd recommend using the new movers, which can be found in the same tab as constraints. Only limitation is that they require an Attachment, so using this code should work:
function AddForceToPlayer(Force,Player) local Attach = Instance.new("Attachment") Attach.Parent = Player.Character.HumanoidRootPart local Force = Instance.new("VectorForce") Force.Parent = Player.Character.HumanoidRootPart Force.Force = Force--a mouthful, but this makes the vectorforce's force equal to the vector3 that you pass as an argument end
heres what else I tried but doesn't make the dummies move at all:
main.tornado.Cone.Touched:Connect(function(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then if humanoid == player.Character.Humanoid then else print("damage worked") print((4*multiplier)) local Attach = Instance.new("Attachment") Attach.Parent = humanoid.Parent.HumanoidRootPart local Force = Instance.new("VectorForce") Force.Parent = humanoid.Parent.HumanoidRootPart Force.Force = Vector3.new(100000,100000,100000) humanoid:TakeDamage((4*multiplier)) end end end)