I want to pick some random children.
My Explorer is
and script is,
do
local model = game.Workspace.Model
local part = model[Random(#model:GetChildren())]
print(part.Name) --It doesnt work
end
thank you
I want to pick some random children.
My Explorer is
and script is,
do
local model = game.Workspace.Model
local part = model[Random(#model:GetChildren())]
print(part.Name) --It doesnt work
end
thank you
This might help you out
local t1 = {}
local random
for i, v in pairs(game.Workspace.Model:GetChildren()) do
table.Insert(t1, v.Name)
end
random = t1[math.Random(1, #t1)]
Or just do
local children = workspace.Model:GetChildren()
local randomChild = children[math.random(1, #children)]