- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleUntitled Paste
TypeDenizen Script
Date2017/08/19 22:59:47 UTC-07:00
ByGuest
Other
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
5700
Particles_Command:
  type: command
  name: invpart2
  description: Particles for Purgatory
  usage: /invpart <player>
  tab complete:
  # No argument, suggest all of them.
  - if <context.args.size> == 0 {
    - determine <server.list_online_players.parse[name]>
  }
  # Argument? Suggest a player who has the name as entered
  - determine <server.list_online_players.parse[name].filter[starts_with[<context.args.last>]]>

  script:
  # Check their permissions
  - if <player.is_op.not> {
    - narrate "<&c>You don't have permission to use that command!"
    - queue clear
  }
  # Make sure they entered an argument
  - if <context.args.size> != 1 {
    - execute "help invpart2" as_player
    - queue clear
  }
  # Find the player
  - define Player <server.match_offline_player[<context.args.get[1]>]||null>
  - if <def[Player]> == null {
    - narrate "<&c>No player found by that name!"
    - queue clear
  }
  # Remove particles
  - if <def[Player].has_flag[InvPart]> {
    - flag <def[Player]> InvPart:!
    - narrate "Stopping effects on player<def[Player].name>"
    - queue clear
  }

  - flag <def[Player]> InvPart:<player>
  - narrate "Starting effects on player<def[Player].name>"

ParticleEffects:
  type: world
  events:
    on server start:
    # Make sure those particles exist - on startup.
    - run s@Create_Particles

Create_Particles:
  type: task
  script:
  # Run particles on their own script - helps to keep queues to a minimum.
  # More efficient
  - foreach <server.list_online_players.filter[has_flag[InvPart]]> {
    - playeffect <def[Value].location> effect:cloud qty:15 target:<def[Value].flag[InvPart]>
  }
  - run <script> delay:10t instantly



RawRaw



Pastes made: 54312