Control

Control blocks “control” what happens based on the condition we give it

Consider the following:

If I, am hungry, I will eat, if not, I will drink some water.

To convert this into tagscript we first create an if statement

{if}

Now we create our condition

{if(I==hungry)}

Now we add the payload or what will happen

{if(I==hungry):Eat}

Finally we add the else

{if(I==hungry):Eat|Drink}

Note

This just pseudo code! If you run this, it will always say Drink Water as I is not the same as hungry!

Boolean Operators (Parameters)

{if(CONDITION):true|false}

{if(carl==carl):true|false} -> true

{if(carl!=carl):true|false} -> false

{if(5>1):true|false} -> true

{if(5<1):true|false} -> false

This is how we determine what to do, in this case we just print out true or false

If the left side is exactly the same as the right side, space and case sensitive

If the left side is different from the right side, space and case sensitive

Greater than or equal too

Lesser than or equal too

Greater than

Lesser Than

Tip

An extremely common question, is how we check if a user was pinged!

We can easily check this by comparing the user id, to target id

{if({user(id)}=={target(id)}):You need to ping someone!|You pinged {target}}

Then/Else (Payload)

{if({user(id)}==235148962103951360):THEN|ELSE}

{if({uses}>10):This command has been used more then 10 times|This command has only been used {uses} times!}

{and({target}==Carl-bot|{target(id)}!=235148962103951360):How dare you impersonate me!}

The payload for conditional blocks can either be a then without an else, or both, you separate these with a pipe |.

If

{if(CONDITION):THEN|ELSE}

The simplest of conditional blocks, checks a singular condition.

Any/Or

{any(CONDITION|CONDITION|CONDITION):THEN|ELSE}

If you want to check if any condition out of whatever you provide are true, you can use an any block, just separate every condition with a |.

All/And

{and(CONDITION|CONDITION|CONDITION):THEN|ELSE}

Nearly identical to the any block, this block just checks if every condition you provide is true.

Break/Shortcircuit

{break(CONDITION):THEN}

When used, if the condition given is true, the tags text output will only be whatever you put as the payload.

Danger

This will not prevent command blocks from running or the embed from the embed builder from sending.