Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

I'm trying to call a function but it doesn't work. What's wrong here?

Asked by
net_h 13
6 months ago

This question has been solved by the original poster.
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?

0
fixed it, moved the first line inside the function and changed "mypart.BrickColor = color" to "mypart.BrickColor = BrickColor.new(color) net_h 13 — 6mo

Answer this question