Paste #11284: Registering a command

Date: 2014/11/16 15:29:21 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21


# Two ways:
# A: The cheaty way
myscript:
  type: world
  events:
     on suicide command:
     - narrate "<yellow>Say goodnight, <player.name>!!!"
     - hurt <player> 500
     - determine fulfilled
# B: The newer cleaner proper way
suicide_command:
  type: command
  name: suicide
  description: ... / usage / etc info that you didn't include
  script:
  - if !<player.has_permission[denizen.killself]> {
     - narrate "YOu no can has dis command"
     - queue clear
     }
  - narrate "<yellow>Say goodnight, <player.name>!!!"
  - hurt <player> 500