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

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 ="Part", workspace)
function makeobject(color)
    mypart.Position =, 5, 5)
    mypart.Name = "Bruh"
    mypart.Transparency = 0.5
    mypart.BrickColor = color
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?

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

Answer this question