- 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
Date2015/11/22 14:50:36 UTC-08:00
ByBloodEko
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
anti_combat_logging:
  type: world
  debug: false
  events:
    on player damages player:
    - flag <context.entity> combat_timer_for_logger d:10s
    on player quits:
    - if <player.has_flag[combat_timer_for_logger]> {
      - run initiate_combat_logger instantly
      - determine ""
      }
    on player logs in:
    - if <player.has_flag[combat_logger]> {
      - determine "kicked <&c>Your account is still logged in due to leaving the server during combat.<&nl><&c>Try again in <&e><player.flag[combat_logger].expiration.in_seconds.as_int><&c> seconds." passively
      }
    on player joins:
    - wait 1t
    - if <player.has_flag[combat_logger_kill_player]> {
      - inventory clear d:<player.inventory>
      - equip <player> head:i@air chest:i@air legs:i@air boots:i@air
      - teleport <player> <player.bed_spawn||<pl.world.spawn_location>>
      - flag <player> combat_logger_kill_player:!
      - heal <player>
      - feed <player> amount:20
      }
    on npc death:
    - if <context.entity.as_npc.has_flag[combat_logger]> {
      - define player <context.entity.as_npc.flag[combat_logger].as_player>
      - drop <def[player].inventory.list_contents.include[<def[player].equipment||li@>].exclude[i@air]||li@> <context.entity.location>
      - inventory clear d:<def[player].inventory>
      - remove <context.entity>
      - flag %player% combat_logger:!
      - flag %player% combat_logger_kill_player
      - wait 1s
      - announce "<&e><def[player].name> left the game"
      }
initiate_combat_logger:
  type: task
  debug: false
  script:
  - create <player.name> player <pl.location> save:npc
  - define npc <entry[npc].created_npc>
  - flag %npc% combat_logger:<player>
  - flag <player> combat_logger:%npc% d:1m
  - vulnerable state:true npc:%npc%
  - trait health state:true npc:%npc%
  - wait 60s
  - if <def[npc].is_spawned> {
    - remove %npc%
    }
  - if <player.has_flag[combat_logger]> {
    - flag <player> combat_logger:!
    }
  - if <player.has_flag[combat_logger_kill_player]> {
    - flag <player> combat_logger_kill_player:!
    }



RawRaw



Pastes made: 59170