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

How do I make a brick that flings a character? (SOLVED)

Asked by 4 years ago
Edited 4 years ago

I have tried a script but it only makes the character sit, here is the code

script.Parent.Touched:connect(function(Touch)
local Humanoid = Touch.Parent:FindFirstChild("Humanoid")
local Head = Touch.Parent.PrimaryPart
if Humanoid and Head then
Humanoid.Sit = true
local vel = Vector3.new(math.random(200, 200), math.random(200, 200), math.random(200, 200))
Head.Velocity = rel
Head.RotVelocity = rel
end
end)

Is there a way to fix it up so it actually flings them? Or do I need a whole other code.

1 answer

Log in to vote
0
Answered by 4 years ago

Simple You Just Made Mistakes.

Try This:

script.Parent.Touched:connect(function(Touch)
local Humanoid = Touch.Parent:FindFirstChild("Humanoid")
local Head = Touch.Parent.PrimaryPart
if Humanoid and Head then
Humanoid.Sit = true
local vel = Vector3.new(math.random(200, 200), math.random(200, 200), math.random(200, 200))
Head.Velocity = vel
Head.RotVelocity = vel
end
end)
Ad

Answer this question