Denizen/Commands/Flag: Difference between revisions

From Citizens Wiki

< Denizen‎ | Commands

(Created page with "== Introduction == Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement. A flag can be p...")
 
Line 6: Line 6:


== Usage ==
== Usage ==
To start off, you should set a flag. You can do this by using
{| class="wikitable" border="1"
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)
|}
You can then use the [[Denizen/Replaceable_Tags#Flags|replaceable tags]] to call back the flag in any script.


== Examples ==
== Examples ==

Revision as of 18:04, 18 June 2013

Introduction

Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement. A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.

If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.

Usage

To start off, you should set a flag. You can do this by using

- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)

You can then use the replaceable tags to call back the flag in any script.

Examples