Denizen/Commands/Flag: Difference between revisions

From Citizens Wiki

< Denizen‎ | Commands

No edit summary
Line 14: Line 14:
...Too much for you? Let's slow it down.
...Too much for you? Let's slow it down.
=== Examples ===
=== Examples ===
== Examples ==

Revision as of 18:31, 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.

...Too much for you? Let's slow it down.

Examples