New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
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 11
5 days 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 11 — 5d

Answer this question