I want to get either a random true or false value, but mine seems really inefficient and I'm sure there are a few much more efficient ways of doing exactly what mine does. Here's my code:
local variable if math.random(1,2) == 1 then variable = true else variable = false end
My way might be the most efficient way but I don't think it is, that code is just a general way of showing what my script does, it's not the full script.
The best way to do this can be done on 1 line, simply have the variable assigned to a condition. Here's the most efficient way:
local variable = math.random(1,2) == 1
That will give you a random true or false value each time.