Date: 2019/09/25 21:03:19 UTC-07:00
Type: Denizen 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# ███████████████████████████████████████████████████████
# █ Log Off NPC █
# █ █
# █ This script requires Citizens! █
# █ It will check on Serverstart if you have █
# █ it installed and will do nothing, if there █
# █ is no Citizens installed! █
# █ █
# █ This script should not need any editing █
# █ except of the proximity trigger messages. █
# █ I do not know more then zzzz in English █
# █ for a sleeping person. █
# █ █
# █ What does script do? █
# █ If someone with the permission offlinenpc █
# █ logs out (disconnects) a NPC is created █
# █ with the same Skin and the Name: █
# █ OFFLINE_<player.name> █
# █ █
# █ On clicking the NPC it will tell you since █
# █ when the player is offline. (Date of logout) █
# █ █
# █ If the Player logs back in, the NPC gets █
# █ deleted. Why a permission? █
# █ If many players join on your Server, just to █
# █ see if they can grief, and never come back █
# █ the spawn would become very crowded, █
# █ very soon ;) █
# █ █
# ███████████████████████████████████████████████████████
log_off_npc:
type: world
debug: false
events:
on server start:
- if <server.list_plugin_names.contains[Citizens]> && <server.has_flag[log_off_npc].not>:
- announce to_console "Welcome First Timer. Enabling Log Off NPCs for you"
- flag server log_off_npc
- stop
on player quit:
- if <server.has_flag[log_off_npc]>:
- if <player.has_permission[offlinenpc]>:
- define npcname "<red>OFFLINE_<&r><player.name>"
- define npclocation <player.location>
- define npcskin <player.skin_blob>
- define player <player>
- flag player offline:true
- create player <def[npcname]> <def[npclocation]> save:<player.name>log_off_npc
- flag <def[player]> offlinenpc:<entry[<player.name>log_off_npc].created_npc>
- adjust <entry[<player.name>log_off_npc].created_npc> skin_blob:<def[npcskin]>
- assignment set script:log_off_npc_assignment npc:<entry[<player.name>log_off_npc].created_npc>
- flag <entry[<player.name>log_off_npc].created_npc> logoff:<util.date.time.day><&dot><util.date.time.month><&dot><util.date.time.year>
- stop
on player join:
- if <player.has_flag[offline]>:
- remove <player.flag[offlinenpc]>
- flag player offlinenpc:!
- flag player offline:!
- stop
log_off_npc_assignment:
type: assignment
debug: false
actions:
on assignment:
- trigger name:click state:true
- trigger name:proximity state:true radius:5
- lookclose true
on enter proximity:
- random:
# █--- You might edit this to fit your language ---█
- chat targets:<npc.location.find.players.within[5]> "zzzz"
- chat targets:<npc.location.find.players.within[5]> "Rapüüüh"
- chat targets:<npc.location.find.players.within[5]> "*schnarch*"
- chat targets:<npc.location.find.players.within[5]> "grummel"
on click:
- chat targets:<player> "Psst! I am offline since <npc.flag[logoff]>"