Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I negate and union object in a plugin?

So I am trying to make a bevel plugin, and so far this is my code:

local ChangeHistoryService = game:GetService("ChangeHistoryService")
local Selection = game:GetService("Selection")

-- Create a new toolbar section titled "Custom Script Tools"
local toolbar = plugin:CreateToolbar("Quantapie Plugins")

-- Add a toolbar button named "Create Empty Script"
local newScriptButton = toolbar:CreateButton("Bevel Tool", "Bevel Tool", "rbxassetid://4458901886")

local function onNewScriptButtonClicked()
	local selectedObjects = Selection:Get()
	if #selectedObjects > 0 and #selectedObjects < 2 then
		local thing = selectedObjects[1]
		if thing:IsA("BasePart") then
			print(thing.Size)
			local wedge = Instance.new("WedgePart")
			wedge.Parent = thing
			wedge.Size = Vector3.new(thing.Size.X+0.2,0.3,0.3)
			wedge.Position = thing.Position + Vector3.new(0,thing.Size.Y/2-0.05,-thing.Size.Z/2+0.05)
			wedge.Orientation = Vector3.new(0, 180, 180)
			wedge.Color = Color3.fromRGB(255,0,0)
			wedge:Negate()
		end
		ChangeHistoryService:SetWaypoint("Action Performed")
	end
end

newScriptButton.Click:Connect(onNewScriptButtonClicked)

So everything is well and fine up until the wedge:Negate() part. This is in a plugin script, but I don't know why it doesn't work. This is what the error is:

Negate is not a valid member of WedgePart "Workspace.Part.Wedge"

Later on, I'd also like to union parts together and I don't know how to do that either.

Could someone help? Thanks for any help!

1 answer

Not sure why that isn't working for you. There is another function called "NegateAsync()", though.

This discussion is preserved as it was. New answers, comments, and votes are closed.