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

Why is part of the script running for the number of times that I right click?

Asked by
zadobyte 692 Moderation Voter
4 years ago

I'm trying to make a script that will grab an npc in which you can throw them afterwards.

001if input.UserInputType == Enum.UserInputType.MouseButton2 and clicked then
002        local welddb
003        clicked = false
004        if firstrc then
005            firstrc = false
006            GrabHitHandling = humanoid.Touched:Connect(function(hit, limb)
007                if not isGrabbing then
008                    grabAnimate:Play()
009                    wait(.55)
010                    if limb.Name == "RightHand" or limb.Name == "RightUpperArm" or limb.Name == "RightLowerArm" then
011                        isGrabbing = true
012                        target = hit.Parent:FindFirstChild("Humanoid")
013                        if target then
014                            EntInv:InvokeServer(player, target)
015                            GrabbingVar:FireServer(isGrabbing)
View all 117 lines...

For some reason, past the

1local thrBody = throwBody:Connect(function()

line, everything is printing for the number of times I have grabbed and thrown in that run. Any ideas?

Answer this question