You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
A randomized character selector
What is the issue? Include screenshots / videos if possible!
Im fairly new, I dont know how to make this
I have 8 models, and I want to select a random one of these 8 on start up
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I did, but im not understanding them
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
--Simplified
--It supposes you know scripting
local HumDescriptions= {
-- Here go all your HumanoidDescriptions.
}
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
local RandomDescription = HumDescriptions[math.random(1,#HumDescriptions)]
Humanoid:ApplyDescription(RandomDescription)
end)
end)
local Character = Characters[math.random(#Characters)]
What this does is simple, but we need to go reverse-mode. See, #Characters returns the amount of values a table has, and :GetChildren() returns a table with the children of the instance you gave it. math.random(#Characters) selects a random number between 1, and the amount of characters in the table. So for this case it would be a random number between 1 and 8. Characters[NUMBER] returns the value at which index it can be found, so for example in the following table:
local t = {"I", "am", "probably", "helpful"}
running this line below would output “probably”