so im creating a script for a personal plugin and its supposed to create a 3D (5,5,5) part to make creating them easier. but for some reason it doesnt work and i just dont understand how.
(btw this is a big script but thats only because theres alot of parts to create each with around 7 properties.)
script:
local toolbar = plugin:CreateToolbar("Round Edges 3D")
local button = toolbar:CreateButton("Round Edges 3D", "Creates a 5x5x5 part with rounded edges at 0,0,0.", " ")
local history = game:GetService("ChangeHistoryService")
local function createPart()
local Part = Instance.new("Part")
Part.Shape = Enum.PartType.Block
Part.Size = Vector3.new(4, 4, 4)
Part.Parent = game.Workspace
Part.Position = Vector3.new(0,0,0)
Part.Anchored = true
Part.BackSurface = "Smooth"
Part.BottomSurface = "Smooth"
Part.FrontSurface = "Smooth"
Part.LeftSurface = "Smooth"
Part.RightSurface = "Smooth"
Part.TopSurface = "Smooth"
local sCorner1 = Instance.new("Part")
sCorner1.Shape = Enum.PartType.Sphere
sCorner1.Size = Vector3.new(1, 1, 1)
sCorner1.Parent = game.Workspace
sCorner1.Position = Vector3.new(2, 2, -2)
sCorner1.Anchored = true
sCorner1.BackSurface = "Smooth"
sCorner1.BottomSurface = "Smooth"
sCorner1.FrontSurface = "Smooth"
sCorner1.LeftSurface = "Smooth"
sCorner1.RightSurface = "Smooth"
sCorner1.TopSurface = "Smooth"
local sCorner2 = Instance.new("Part")
sCorner2.Shape = Enum.PartType.Sphere
sCorner2.Size = Vector3.new(1, 1, 1)
sCorner2.Parent = game.Workspace
sCorner2.Position = Vector3.new(-2, 2, -2)
sCorner2.Anchored = true
sCorner2.BackSurface = "Smooth"
sCorner2.BottomSurface = "Smooth"
sCorner2.FrontSurface = "Smooth"
sCorner2.LeftSurface = "Smooth"
sCorner2.RightSurface = "Smooth"
sCorner2.TopSurface = "Smooth"
local sCorner3 = Instance.new("Part")
sCorner3.Shape = Enum.PartType.Sphere
sCorner3.Size = Vector3.new(1, 1, 1)
sCorner3.Parent = game.Workspace
sCorner3.Position = Vector3.new(-2, 2, 2)
sCorner3.Anchored = true
sCorner3.BackSurface = "Smooth"
sCorner3.BottomSurface = "Smooth"
sCorner3.FrontSurface = "Smooth"
sCorner3.LeftSurface = "Smooth"
sCorner3.RightSurface = "Smooth"
sCorner3.TopSurface = "Smooth"
local sCorner4 = Instance.new("Part")
sCorner4.Shape = Enum.PartType.Sphere
sCorner4.Size = Vector3.new(1, 1, 1)
sCorner4.Parent = game.Workspace
sCorner4.Position = Vector3.new(2, 2, 2)
sCorner4.Anchored = true
sCorner4.BackSurface = "Smooth"
sCorner4.BottomSurface = "Smooth"
sCorner4.FrontSurface = "Smooth"
sCorner4.LeftSurface = "Smooth"
sCorner4.RightSurface = "Smooth"
sCorner4.TopSurface = "Smooth"
local sCorner5 = Instance.new("Part")
sCorner5.Shape = Enum.PartType.Sphere
sCorner5.Size = Vector3.new(1, 1, 1)
sCorner5.Parent = game.Workspace
sCorner5.Position = Vector3.new(2, -2, 2)
sCorner5.Anchored = true
sCorner5.BackSurface = "Smooth"
sCorner5.BottomSurface = "Smooth"
sCorner5.FrontSurface = "Smooth"
sCorner5.LeftSurface = "Smooth"
sCorner5.RightSurface = "Smooth"
sCorner5.TopSurface = "Smooth"
local sCorner6 = Instance.new("Part")
sCorner6.Shape = Enum.PartType.Sphere
sCorner6.Size = Vector3.new(1, 1, 1)
sCorner6.Parent = game.Workspace
sCorner6.Position = Vector3.new(-2, -2, 2)
sCorner6.Anchored = true
sCorner6.BackSurface = "Smooth"
sCorner6.BottomSurface = "Smooth"
sCorner6.FrontSurface = "Smooth"
sCorner6.LeftSurface = "Smooth"
sCorner6.RightSurface = "Smooth"
sCorner6.TopSurface = "Smooth"
local sCorner7 = Instance.new("Part")
sCorner7.Shape = Enum.PartType.Sphere
sCorner7.Size = Vector3.new(1, 1, 1)
sCorner7.Parent = game.Workspace
sCorner7.Position = Vector3.new(-2, -2, -2)
sCorner7.Anchored = true
sCorner7.BackSurface = "Smooth"
sCorner7.BottomSurface = "Smooth"
sCorner7.FrontSurface = "Smooth"
sCorner7.LeftSurface = "Smooth"
sCorner7.RightSurface = "Smooth"
sCorner7.TopSurface = "Smooth"
local sCorner8 = Instance.new("Part")
sCorner8.Shape = Enum.PartType.Sphere
sCorner8.Size = Vector3.new(1, 1, 1)
sCorner8.Parent = game.Workspace
sCorner8.Position = Vector3.new(2, -2, -2)
sCorner8.Anchored = true
sCorner8.BackSurface = "Smooth"
sCorner8.BottomSurface = "Smooth"
sCorner8.FrontSurface = "Smooth"
sCorner8.LeftSurface = "Smooth"
sCorner8.RightSurface = "Smooth"
sCorner8.TopSurface = "Smooth"
local cEdge1 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(0, 2, -2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge2 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,90,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(-2, 2, 0)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge3 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(0, 2, 2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge4 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,90,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(2, 2, 0)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge5 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,90)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(2, 0, -2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge6 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(0, -2, -2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge7 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,90,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(-2, -2, 0)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge8 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(0, -2, 2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge9 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,90,0)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(2, -2, 0)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge10 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,90)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(-2, 0, -2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge11 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,90)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(-2, 0, 2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
local cEdge12 = Instance.new("Part")
cEdge.Shape = Enum.PartType.Cylinder
cEdge.Size = Vector3.new(4, 1, 1)
cEdge.Orientation = Vector3.new(0,0,90)
cEdge.Parent = game.Workspace
cEdge.Position = Vector3.new(2, 0, 2)
cEdge.Anchored = true
cEdge.BackSurface = "Smooth"
cEdge.BottomSurface = "Smooth"
cEdge.FrontSurface = "Smooth"
cEdge.LeftSurface = "Smooth"
cEdge.RightSurface = "Smooth"
cEdge.TopSurface = "Smooth"
history:SetWaypoint("Created part.")
end
button.Click:Connect(createPart)

2 comments
guess what? im stupid and frogot to put the numbers of each cEdge :/
couldn't you use a loop?