GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 14 Dec 2013 08:30 PM |
Can you use math.random() for boolean values…
for Example:
while wait(1) do script.Parent.PointLight.Enabled = math.random(true, false) end
??? |
|
|
| Report Abuse |
|
|
|
| 14 Dec 2013 08:30 PM |
| No, it only accepts integers in it's parameters I believe |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 14 Dec 2013 08:32 PM |
what if I did something like
on = true off = false
while wait(1) do script.Parent.PointLight.Enabled = math.random(on, off) end |
|
|
| Report Abuse |
|
|
|
| 14 Dec 2013 08:34 PM |
| No, the variables would be the same thing as you originally posted so there would be no different outcome |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 14 Dec 2013 10:17 PM |
you can do:
while wait(1) do script.Parent.PointLight.Enabled = math.random(2)==1 end
or easier to understand:
while wait(1) do script.Parent.PointLight.Enabled = math.random(2)==1 and true or false end
it is redundant though
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
| |
|