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

why will an in game negate operation with a SubtractASync() not work!!!???

Asked by 4 years ago

what i want to do is make a kind of "hole puncher" sniper by subtracting the beam to the part that is being shot at. however, it doesn't work and the output says "Attempt to connect failed: Passed value is not a function".

here is the function to punch the hole

a script in serverScriptService

01negatePartRemoteFunction.OnServerInvoke = function (beam,part,player)
02    local success, punchedPart = pcall(function()
03        return part:SubtractAsync({beam})
04    end)
05 
06    if success then
07        print("The union operation is successful.")
08    end
09 
10    if success and punchedPart then
11        punchedPart.Position = part.Position
12        punchedPart.Anchored = true
13        punchedPart.Name = part.Name
14        punchedPart.Parent = part.Parent
15        part:Destroy()
16        print("The replacement is successful.")
17        negateSuccess:FireClient(player)
18    end
19end

Answer this question