local Folder = {
script.Parent.Folder["1"]
script.Parent.Folder["2"]
script.Parent.Folder["3"]
}
local Random = Folder[math.random(1,3)]
if Random == 2 then
-- do stuff
end
I know the code I put is wrong but basically I want it to go:
take random item out the folder > if the random item is … > then do this
local Folder = {
script.Parent.Folder["1"],
script.Parent.Folder["2"],
script.Parent.Folder["3"]
}
local randFolderChild = Folder[math.random(1, #Folder)]
if randFolderChild.Name == "2" then
-- do stuff
end