- 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: NPC Skin Save/Load


By mcmonkey
Created: 2018/07/07 17:00:34 UTC-07:00 (5 years and 292 days ago)
Edited: 2018/07/07 17:00:34 UTC-07:00 (5 years and 292 days ago)
Likes: 2

Staff pick as of: 2018/07/07 17:00:40 UTC-07:00 (5 years and 292 days ago)
Denizen Version: 1.0.2
Script Version: 1
Description:

Just a quick+easy tool to save and load NPC skins on a server (so you don't have to reload from Mojang every time)


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
37
38
39
40
41
42
43
44
45
4500

npc_skin_save_command:
    type: command
    name: saveskin
    usage: /saveskin [name]
    description: Saves ye skin
    permission: denizen.saveskin
    script:
    - inject npc_skin_validate
    - flag server npc_skins.<context.args.get[1].escaped>:<player.selected_npc.skin_blob>;<player.selected_npc.name>

npc_skin_load_command:
    type: command
    name: loadskin
    usage: /loadskin [name]
    description: Loads ye skin
    permission: denizen.saveskin
    script:
    - inject npc_skin_validate
    - if !<server.has_flag[npc_skins.<context.args.get[1].escaped>]> {
      - narrate "No skin found"
      - queue clear
      }
    - adjust <player.selected_npc> skin_blob:<server.flag[npc_skins.<context.args.get[1].escaped>]>

npc_skin_validate:
    type: task
    script:
    - if !<player.has_permission[denizen.saveskin]||<<player.is_op||context.server>>> {
      - narrate "Nope!"
      - queue clear
      }
    - if <context.args.size> == 0 {
      - narrate "/saveskin [name]"
      - queue clear
      }
    - if <player.selected_npc||null> == null {
      - narrate "Select an NPC!"
      - queue clear
      }










View History