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

Why isn't this script flinging the humanoid?

Asked by
Synth_o 136
6 years ago
01local Tool = script.Parent;
02local Handle = Tool:WaitForChild("Handle");
03local Activated = true
04local PlayerName = Tool.Parent.Parent.Name
05local Player = game.Players:FindFirstChild(PlayerName)
06local BodyPosition = Instance.new("BodyPosition")
07 
08Tool.Activated:Connect(function()
09    local ray  = Ray.new(
10        Handle.CFrame.p,
11        (Handle.CFrame.lookVector * -1).unit * 5
12    )
13    local part, position = workspace:FindPartOnRay(ray, Player.Character, false, true)
14    if Activated == true then
15        Activated = false
View all 35 lines...

The script is supposed to basically fling the humanoid it touches backward a little bit, but at the moment it does not do that and I do not know why. There are no errors in the script. Any help would be appreciated!

1 answer

Log in to vote
0
Answered by 6 years ago

I don't know if I'm being completely correct, but I believe it's because the humanoid needs to be in the "sitting" stance if it will fling. Just code "Humanoid.Sit = true" somewhere before you want it to be flung, and I think it'll work.

Ad

Answer this question