How to get a Random Bool Value that False

	local function GetMissions()
		for i, v in pairs(game.ServerStorage.Mission:GetChildren()) do
			if v.Value == false then
				print(v)
				
			end
		end
	end

I figured out how to get random bool value that is false. I wanted to know how to get only using math.random.

local function GetMission()
	local Mission = game.ServerStorage.Mission:GetChildren()
	local Available = {}
	for i,v in pairs(Mission) do
		if not v.Value then
			table.insert(Available, v)
		end
	end
	local SelectedMission = Available[math.random(1, #Available)]
	return SelectedMission
end
1 Like

If I insert it into a table right? Is there a time I’m going to have to remove it?

If you are talking about garbage collection, you don’t have to worry about it in this case


You could make it a math.random and make the min 0 and max 1 and make the 0 = true( or false) and make 1 the opposite of 0 so in our case false.

1 Like