Changing from a remote event to a remote function fixed my issue, I believe it had something to do with calling the union too many times before the previous union finished, so I changed it to a remote function and made a debounce.

So this is my first time in a very long time that I am dealing with Remote Events, so that honestly might be the problem here.

What I am trying to do is let a tool select a two parts and on the server side union them all together, I've got the selection down and I have a good enough understanding of how to union parts with a script. The only problem I can see is the Remote Event not working.

part1 and part2 are just two parts in the workspace called "part1" and "part2" that I have hard coded into the variable section of my script.

local script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local REvent = ReplicatedStorage:WaitForChild("REvent")
REvent:FireServer(part1,part2,0)

script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
createPartEvent.Name = "REvent"

local function subtract(player, part, negativePart, collisionFidelity)
		local subtractor = {negativePart}
		local union = part:SubtractAsync(subtractor, collisionFidelity)
		part:Destroy()
		negativePart:Destroy()
end
 
createPartEvent.OnServerEvent:Connect(subtract)

3 comments

0

Give the full code you don't define part1 or part2 anywhere and give more context rather than a generic "it doesn't work" and post any errors if applicable. What is not working specifically? Have you tried adding print() calls to see if the codes are even executing? 

0

yes I have used prints, but they don't tell me any info which I don't already know (prints won't do anything if nothing is being changed). As for the parts they're just regular parts that are overlapping each other.

0

Oh I found a solution, not sure what the problem was, but changing it from a remote event to a remote function worked.