Why does it print('true') and it print('false')?

Hello, from the scripts below, i do not understand why the second script print both “true” and “false” , and the other one only print “false” (as i want it do). Is there a way to fix the second script so it only print(‘true’) ?

local Check = Instance.new('BoolValue')
Check.Value = false
local Test = Check.Value == true and print('true') or print('false')

Helpa

local Check = Instance.new('BoolValue')
Check.Value = true
local Test = Check.Value == true and print('true') or print('false')

Helpb

1 Like

Do this:

local Check = Instance.new('BoolValue')
Check.Value = false

print(Check.Value)

Or if you want to do it with your method use this:

local Check = Instance.new('BoolValue')
Check.Value = true

local Test = Check.Value and "true" or "false"
print(Test)
3 Likes

Thank you, i still do not understand why does it print the both with my script. But at least you fixed this issue thank you :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.