- 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








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Hugs


By Fortifier42
Created: 2016/02/02 17:23:53 UTC-08:00 (8 years and 90 days ago)
Edited: 2016/02/02 17:23:53 UTC-08:00 (8 years and 90 days ago)
Likes: 0

Staff pick as of: 2016/02/05 17:02:40 UTC-08:00 (8 years and 87 days ago)
Denizen Version: Dev #457
Script Version: 1.0
Description:

Share the love, give some hugs.

Only command: /hug <player> ... (You can list multiple players!)


Download script | View raw script
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
3600

Hug_Command:
  type: command
  debug: false
  name: Hug
  aliases:
  - hugs
  usage: /hug <&lt>player<&gt> ...
  description: Give people a hug!
  tab complete:
  - if <context.server> {
    - queue clear
  }
  - determine <server.list_online_players.exclude[<player>].parse[name].filter[starts_with[<context.args.last||>]]>
  script:
  - choose <context.args.size>:
    - case 0:
      - narrate "<&c>Sorry, you must enter atleast one person to love!"
      - queue clear
    - default:
      - if <context.server> {
        - narrate "<&c>Sorry, but only players can give some love!"
        - queue clear
      }
      - define Players li@
      - foreach <context.args> {
        - define P <server.match_player[<def[Value]>]||null>
        - if <def[P]> != null && <def[P]> != <player> && <def[Players].contains[<def[P]>].not> {
          - define Players <def[Players].include[<def[P]>]>
        }
      }
      - if <def[Players].is_empty> {
        - narrate "<&c>Sorry, but we couldn't find any of those players.. :("
        - queue clear
      }
      - announce "<&6><player.name><&r> has given <&6><def[Players].formatted><&r> a hug!"





View History