Date: 2014/06/03 16:49:30 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
Normal Chat:
type: world
events:
on player chats:
- if <player.flag[talkingallowed]> {
- ^narrate "<&7>You say, "<context.message><&7>"."
- ^flag player lastchat:<context.message>
- ^run localchatdisplayer
}
else {
- if <player.flag[chatblockedreason]> != null {
- ^narrate "<&7><player.flag[chatblockedreason]>"
}
- determine cancelled
'localchatdisplayer':
type: task
script:
- flag player "hearsyourmessage:false"
- foreach <server.list_players> {
- if <player.location.distance[<%value%.location>].horizontal> < 5000 {
- narrate '<player.flag[currentrank]> <&7><player.name> <&7>is heard in the distance saying, "<context.message>".' t:<%value%>
- flag player "hearsyourmessage:true"
}
else <player.location.distance[<%value%.location>].horizontal> < 3000 {
- narrate '<player.flag[currentrank]> <&7><player.name> <&7>yells, "<context.message>".' t:<%value%>
- flag player "hearsyourmessage:true"
}
else <player.location.distance[<%value%.location>].horizontal> < 1000 {
- narrate '<player.flag[currentrank]> <&7><player.name> <&7>says, "<context.message>".' t:<%value%>
- flag player "hearsyourmessage:true"
}
else <player.location.distance[<%value%.location>].horizontal> < 20 {
- narrate '<player.flag[currentrank]> <&7><player.name> <&7>whispers, "<context.message>".' t:<%value%>
- flag player "hearsyourmessage:true"
}
}
- if <player.flag[hearsyourmessage]> == false narrate "<&7>No one hears you."