Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I refer to every part inside of a model? (game.Workspace.Model), I have about 10 parts in it

Asked by 9 years ago

I tried: G = game.Workspace.Model:GetChildren(), and then later I did

function random() for m = 1, 3 do return(math.random(10)) end end

random()

if random() == 1 then G.BrickColor = BrickColor.new("Really red") print("Hello")

elseif random() == 3 then G.BrickColor = BrickColor.new("Cyan") print("Hello 3")

elseif random() == 5 then G.BrickColor = BrickColor.new("Camo") print("Hello 5")

elseif random() == 7 then G.BrickColor = BrickColor.new("Hot pink") print("Hello 7")

elseif random() == 9 then G.BrickColor = BrickColor.new("Toothpaste") print("Hello 9")

end

I get the messages when it prints, but I never do get any color changes from the parts. This should be very easy.. But I started scripting this week :P

Answer this question