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

bool value or number value?

Asked by 4 years ago

what is better to use

if script.Parent.[ValueName].Value = 1 then

-- do something end

elseif script.Parent.[ValueName].Value = 2 then

-- do something end [POSSIBLE}END}IDK]

or

use a bool value and do this

what is better to use

if script.Parent.[ValueName].Value = true then

-- do something end

elseif script.Parent.[ValueName].Value = false then

-- do something end [POSSIBLE}END}IDK]

0
return but i'm not planing on returning anything i just want to store 3 stats and brick colors lon233bcc 31 — 4y

1 answer

Log in to vote
1
Answered by
Mr_Unlucky 1085 Moderation Voter
4 years ago

Booleans return true or false. Integers return whole numbers.

Booleans are the right choice.

Also, use "==" and not "=". You should use double "=" for conditional statements and one "=" for stuff like changing values of variables/values.

Ad

Answer this question