I have a game, and I want it to choose a random model that is in Lighting. How would I go about doing this?
local Lighting = game:GetService("Lighting") local Map = Lighting:GetChildren()[math.random(1, #Lighting:GetChildren())]
I would use a loop (:GetChildren) and then use math.random for every loop cycle.
math.randomseed(tick()) local maps = game.Lighting:GetChildren() print(maps[math.random(1,#maps)])