Interprets commands conditionally.
Every if statement starts with
$if[condition] and has to end with
$else is optional.
$ifto specify a block of code to be executed, if a specified condition is true.
$elseto specify a block of code to be executed, if the same condition is false.
$elseifto specify a new condition to check, if the first condition is false (can be only used in BDScript 2)
$ifto specify a new condition to check, if the first condition is false.
$endifto end a if statement.
$if[$username==kubastick] Hi Kuba! $else Hi $username! $endif
$if[$getUserVar[money]>0] You're not broke $endif
$if[$username==noituri] $if[$message[<]==nice] Noit said nice $endif $endif
Only for BDScript 2:
$if[$message==test] You said test $elseif[$message==BDFD] Bot Designer for Discord $elseif[$username==noituri] Hi Noituri! $else I don't know what to say $endif
Note: You can use multiple
$if uses the format of: if
x is related accordingly (based on the "sign") with
y then the code below runs.
== - Equal
!= - Not Equal
< - Less Than
> - Greater Than
>= - Greater Than Or Equal To
<= - Less Than Or Equal To
- These signs could vary in meaning based on the order or intent of the if statement.
- If you are using text as your
y, you can not use any other signs besides
!=. However for numbers, you can use any sign shown in the above list.
$elseif can be only used in BDScript 2. If you use different BDScript edition please read the note below.
Note: Normal BDScript and BDScript Unstable don't have a specific function for else if blocks, but you can still do them by using
$if. The difference between
$ifis that else doesn't need a condition. Where as else if is still an if so it needs a condition. The main purpose for else if is to make it so only one if statement runs. Unlike regular if statements, the else if blocks should end with
$elsethen start with another
$if. Once you are done with your else if statements, close all of them with x number of
x= number of else if statements) at the bottom of the last else if statement.
$if[$checkContains[$message;hi]==true] Hello $else $if[$checkContains[$message;yes]==true] Sure! $endif $endif