Get random model from a folder

  1. What do you want to achieve?: Pick a random model from a folder

  2. What is the issue?: Not sure how to do it well.

  3. What solutions have you tried so far?: I have made it but i am going to be getting a random model from a folder with about 200 models. So i just dont want a 800 line script for that.

1 Like

why would you need 800 lines to get a random model?
can we see your current code?

local folder = folderPath -- modify this
local rand = Random.new() 

local modelList = folder:GetChildren()
local model = modelList[rand:NextInteger(1,#modelList)]
2 Likes

How do i move a model to a CFrame

If the model has a PrimaryPart, you can just use SetPrimaryPartCFrame.

Please mark one of my replies as the solution, thank you.

1 Like

If you have made a mistake whilst typing a comment, you shouldn’t post it.

image

1 Like