Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I chose True or False at random with script?

Asked by 5 years ago

Hello, I'm working on a code-type game that involve a bool value, which needs to be completely random. Whenever I try to make it random, it is always end up being true. Here's the methods that I've tried.

local BoolValue = script.Parent.BoolVaule
BoolValue.Value = Random -- Didn't work
BoolValue.Value = true or false -- Didn't work
BoolVaule.Value = Random(true,false) -- Didn't work
BoolValue.Value = Random(true or false) -- Also didn't work
0
wait, what are you attempting?????????? starmaq 1290 — 5y
0
why would you think that will work starmaq 1290 — 5y

1 answer

Log in to vote
0
Answered by
syuuhP 0
4 years ago

local trueAndFalse = {true, false}

trueAndFalse[math.random(1, 2)]

sorry im a year too late hahaha

Ad

Answer this question