local mypart = Instance.new("Part", workspace)
function makeobject(color)
mypart.Position = Vector3.new(5, 5, 5)
mypart.Name = "Bruh"
mypart.Transparency = 0.5
mypart.BrickColor = color
end
makeobject("Really red")
makeobject("Really blue")
So the point of this 'script' is to make two bricks when the function is called one is really red and one is really blue. but it makes ONE part and without a color. what's the issue here?

1 comment
fixed it, moved the first line inside the function and changed "mypart.BrickColor = color" to "mypart.BrickColor = BrickColor.new(color)