Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a script where it will pick 1 brick out of like 10 bricks in a model?

Its so I can make a random one catch on fire

1 answer

Lets say that the model is the scripts parent:

local Model = script.Parent
local RandomBrick = Model:GetChildren()[math.random(1, #Model:GetChildren())]

This uses math.random() to choose a random child from the scripts parent (the model).

This discussion is preserved as it was. New answers, comments, and votes are closed.