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.
kylerzong
(kylerzong)
November 14, 2020, 6:23am
#2
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?
kylerzong
(kylerzong)
November 14, 2020, 6:26am
#4
If you are talking about garbage collection, you don’t have to worry about it in this case
This article is meant to teach you how to prevent memory leaks and how the Roblox lua garbage collector works.
What is garbage collection?
Garbage collection, for those who are new to the term, is the process that a lot of languages such as JavaScript, python, and lua use to clean up memory. When values are no longer being used, they get garbage collected thus freeing up any memory they used.
What are memory leaks?
Memory leaks may sound like something scary. It might sound like it means infor…
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