-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathskin_save_load.dsc
63 lines (60 loc) · 1.78 KB
/
skin_save_load.dsc
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
58
59
60
61
62
63
# +-------------------
# |
# | NPC Skin Save/Load
# |
# | A drop-in helper for saving/loading skins for reuse.
# |
# +-------------------
#
# @author mcmonkey
# @date 2019-08-26
# @denizen-build REL-1700
# @script-version 1.0
#
# Installation:
# Just put the script in your scripts folder and reload.
#
# Usage:
# Select an NPC and use command "/saveskin" or "/loadskin"
# You can do:
# /saveskin [name] - Saves the NPC's skin to the name you specify.
# /loadskin [name] - Gives the NPC the skin saved for the name you used.
#
# Uses permission "denizen.saveskin"
#
# ---------------------------- END HEADER ----------------------------
npc_skin_save_command:
type: command
debug: false
name: saveskin
usage: /saveskin [name]
description: Saves ye skin
permission: denizen.saveskin
script:
- inject npc_saveskin_command_validate
- flag server npc_skins.<context.args.get[1].escaped>:<player.selected_npc.skin_blob>;<player.selected_npc.name>
- narrate "<&[base]>Skin saved."
npc_skin_load_command:
type: command
debug: false
name: loadskin
usage: /loadskin [name]
description: Loads ye skin
permission: denizen.saveskin
script:
- inject npc_saveskin_command_validate
- if !<server.has_flag[npc_skins.<context.args.get[1].escaped>]>:
- narrate "<&[error]>No skin found for the name specified."
- stop
- adjust <player.selected_npc> skin_blob:<server.flag[npc_skins.<context.args.get[1].escaped>]>
- narrate "<&[base]>Skin loaded!"
npc_saveskin_command_validate:
type: task
debug: false
script:
- if <context.args.size> == 0:
- narrate "<&[error]>Must specify a skin name."
- stop
- if <player.selected_npc||null> == null:
- narrate "<&[error]>Must select an NPC!"
- stop