The script doesn't spawn the part correctly.
function generatePart(Color) local part = Instance.new("Part",game.Workspace) part.Anchored = false part.Transparency = 0.5 part.BrickColor = BrickColor.new (Color) part.Parent = workspace end generatePart("Bright Green") generatePart() generatePart() generatePart()
By the way, I haven't finished the other generate part but it doesn't spawn green part.
"Bright Green" is not a color. It is "Bright green" Check out colors here: https://developer.roblox.com/en-us/articles/BrickColor-Codes
function generatePart(Color) local part = Instance.new("Part",game.Workspace) part.Anchored = false part.Transparency = 0.5 part.BrickColor = BrickColor.new (Color) part.Parent = workspace end generatePart("Bright green") generatePart() generatePart() generatePart()
Maybe change it to Color3
function generatePart(Color) local part = Instance.new("Part",workspace) part.Anchored = false part.Transparency = 0.5 part.Color = Color3.new(Color) end generatePart(255,0,0) -- Red
while true do wait(1) function generatePart(Color) local part = Instance.new("Part",game.Workspace) part.Anchored = false part.Transparency = 0.5 part.BrickColor = BrickColor.new ( "Bright Green") part.Parent = workspace end end generatePart()
You have to supply a parameter for every single one of the times you called the function, or else you will get an error.