On line 10-19 there is a table that should loop around turning each surface of "Part" smooth but it won't,why? How would I fix this problem?
Player = game.Players.LocalPlayer
Character = game.Players.LocalPlayer.Character
Tool = script.Parent
----------------------------
function CreatePart(CFPosition)
local Part = Instance.new("Part",game.Workspace)
Part.FormFactor = "Custom"
Part.Size = Vector3.new(1,0.2,1)
Part.CFrame = CFPosition
local Surfaces ={
Part.BackSurface,
Part.BottomSurface,
Part.FrontSurface,
Part.LeftSurface,
Part.RightSurface,
Part.TopSurface}
for i,v in pairs (Surfaces)do
print(v)
v = "Smooth"
end
return Part
end
function RandomNumbers(Num1,Num2)
local RandomNumbers = {
math.random(Num1,Num2),
math.random(Num1,Num2),
math.random(Num1,Num2)}
return RandomNumbers
end
----------------------------
Tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function()
for Index = 1,5 do
local PartPosition = CFrame.new(Mouse.Hit.p)*CFrame.new(0,1,0)
local RandomNumbers = RandomNumbers(1,10)
local RandomizedPosition = PartPosition*CFrame.new(RandomNumbers[1],RandomNumbers[2],RandomNumbers[3])--Scatters part at random positions in diffrent axis
local Parts = CreatePart(RandomizedPosition)
Parts.Name = "Part"..Index
end
end)
end)
P.s I got no errors in the output

3 comments
What's the brackets for in line 3?
To adjust each surface property. For example, for the first loop, it would take "Back" in the array and reference it to "surface" in line 3. Since all surfaces have the common word "Surface", he cleverly added (or concatenate) the string value that's from the array to "Surface". "BackSurface" would result, and the property of 'Part' for the apparent BackSurface would be set to "Smooth"
The brackets act just like
.except that you can use variables inside, instead of just names (e.g., usingpart["Name"]vspart.Name)