Can't Make a Randomizer

  1. I’m trying to make a randomizer for my game which could make it alot funnier.

  2. I don’t know what scripts it needs to work.

  3. Looked for everything, cant find anything about randomizer.

This is the script.
for _,c in pairs(workspace:GetDescendants()) do
local foundsound = c:FindFirstChildOfClass(“Sound”)
if c:IsA(“Sound”) then
local c = script.Parent:FindFirstChildOfClass(“Sound”)
c.SoundId = c.Parent:FindFirstChildOfClass(“Sound”).SoundId
end
end

I’m a bit confused. what are you trying to do exactly?

Something like this
em
(randomized names and sounds)

This is how you get a random value from a list of random objects (names, numbers, etc)

List = {"Name1","Name2","Name3","Name4"}

local R = Random.new()

local random_value = List[R:NextInteger(1,#List)]

print(random_value)