Can you tell me what I did wrong, because this script ins't working

– Function to create a hole in a part
local function createHole(piece, position)
local sphere = Instance.new(“Part”)
sphere.Shape = Enum.PartType.Ball
sphere.Size = Vector3.new(1, 1, 1)
sphere.CFrame = position
sphere.Color = piece.Color
sphere.Transparency = 1
sphere.CanCollide = false
piece.Anchored = false
sphere.Anchored = true
local Parts = {sphere}
sphere.Parent = game.Workspace

local success, newUnion = pcall(function()
	return piece:SubtractAsync(Parts)
end)
if success and newUnion then
	print("Work")
	newUnion.Position = piece.Position
	newUnion.Parent = piece.Parent
	piece:Destroy()
	
	newUnion.Anchored = true
	return newUnion
end

end
– Function to destroy a part and create a hole in its place

1 Like

Are they any errors? Also what is the script doing? Are they multiple script or did you just fail to use DevForum formatting right?

1 Like