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

How can I make it so that a different child is found every time in :FindFirstChild()?

Asked by 5 years ago

As far as I know, it will keep choosing the same child if repeated on a parent.

0
i dont think there is a "simple" way CjayPlyz 643 — 5y
0
Well, yea, because it's FindFirstChild, not FindRandomChild. Most you can do is store all children with the same name in a table and then select a random item from the table. Amiaa16 3227 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago

Use this script:

local FindChild = game.TYPE HERE WHERE YOU WANT IT TO SELECT A CHILD 
local SelectedChild = FindChild[math.random(1, #FindChild)]
Ad

Answer this question