Date: 2016/10/06 17:27:50 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
Tele-rune:
type: world
#<def[x]> not %x%
#Lokacije sa .simple pisati!
events:
on player right clicks with Teleport_Rune:
- narrate '<yellow>Who would you like to teleport to?'
- narrate '<yellow>Say player name to send request or say Exit teleport'
- narrate '<red>Note:<yellow> You have 15 seconds to say either name or Exit'
- flag player Tele_Rune duration:15s
on player chats:
- if <player.has_flag[Tele_Rune]> && <server.list_online_players.contains[<context.message.as_player>]> {
- determine <context.recipients.exclude[<server.list_online_players>]> passively
- narrate '<yellow>Waiting for <context.message> to accept! '
- narrate '<yellow><player.name> is trying to Teleport to you!' targets:<context.message.as_player>
- narrate '<yellow>Write /accept to accept teleport or /decline to decline teleport!' targets:<context.message.as_player>
- flag <context.message.as_player> TQ duration:15s
- flag <player> <context.message> duration:15s
- take item:i@Teleport_Rune qty:1
- wait 1t
- flag player Tele_Rune:!
}
- if <player.has_flag[Tele_Rune]> && <context.message> == 'exit' {
- determine <context.recipients.exclude[<server.list_online_players>]> passively
- narrate '<yellow>You Exited Teleport'
- flag player Tele_rune:!
}
on accept command:
- if <player.has_flag[TQ]> {
- flag player TQ:!
- narrate '<yellow><player.name> Accepted your Request!' targets:<server.get_players_flagged[<player.name>]>
- narrate '<yellow>Teleporting in 2 seconds!' targets:<server.get_players_flagged[<player.name>]>
- wait 2
- teleport <server.get_players_flagged[<player.name>]> location: <player.location>
- flag <server.get_players_flagged[<player.name>]> <player.name>:!
- queue clear
}
- narrate '<yellow>You dont have pending teleport requests!'
on decline command:
- if <player.has_flag[TQ]> {
- narrate '<yellow>Player Declined your Teleport!' targets:<server.get_players_flagged[<player.name>]>
- flag player TQ:!
- flag <server.get_players_flagged[<player.name>]> <player.name>:!
- narrate '<yellow>You Declined Teleport Request!'
- queue clear
}
- narrate '<yellow>You dont have pending teleport requests!'
Teleport-Accept:
type: command
name: accept
description: Accepts pending teleport request.
usage: /accept
Teleport-decline:
type: command
name: decline
description: Declines pending teleport request.
usage: /decline
Teleport_Rune:
type: item
material: flint
display name: <blue>Teleport Rune
lore:
- <gold>Teleports you to another npc!
- <gold>Right click to use it