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

My script that randomly picks a bodymesh doesn't work, any help ?

Update : I got a better idea for the request, i'd like a script that randomly picks a folder's files to extract, but i dunno how to make that happen.

I don't know how to make a script that picks between 3 groups of body meshes or not picking any at all (Body meshes are meshes used to change the body's model) for a humanoid rig. Can someone help me ? I already tried this :

local part = model:GetChildren([math.random(1,#model:GetChildren())]

I also tried this :

local random = {"womanbody", "malebody", "meshbody"}
local part = model:GetChildren()random[math.random(1,#random)]
-- Shoutouts to Daemonophobia

with this setup : Picture .

Is something wrong ?

1 comment

0

not a request site, its a site to help scripting. You didnt have us any code.

1 answer

This is the way it should be:

local part = model:GetChildren()[math.random(1,#model:GetChildren())]

2 comments

0

doesn't work

0

It works. It's likely a logic error. Is there a stack trace?

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