Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

wait, what are you attempting??????????

0

why would you think that will work

1 answer

local trueAndFalse = {true, false}

trueAndFalse[math.random(1, 2)]

sorry im a year too late hahaha

This discussion is preserved as it was. New answers, comments, and votes are closed.