Chat Bubbles


Author: beecee
Created: 2014-06-27T18:21:48-0400
Edited: 2014-06-28T20:20:09-0400
Denizen Version: 1479
Views: 43
Downloads: 1008
Likes: 1


WGET
Description: displays the player chat above the player's head for a set amount of time.

Requires no moderation. If you want to activate the system without restarting your server simply do
/ex run lumichatbubbleloop (players will have to relog before it takes effect on them)

If you server is struggling running the script, you may want to increase the delay at the very last line of the script, however this will decrease the performance of the script itself.

RAW file (USE THIS): http://mcmonkey.org/paste/5923.txt

"lumichatbubble":
    type: world
    debug: false
    events:
      on server start:
      - run lumichatbubbleloop
      on stop command:
      - if <context.console> || <player.is_op> {
        - foreach <server.list_online_players> {
          - remove <%value%.flag[chatbubble].as_npc>|<%value%.flag[chatbubblecarrier].as_npc>
          }
        }
      on player joins:
      - inject locally path:initiatechatbubble
      on player quits:
      - remove <player.flag[chatbubble].as_npc>|<player.flag[chatbubblecarrier].as_npc>
      on player chats:
      - flag "lastchat:<&e><context.message.substring[1,64]>" duration:10s
    initiatechatbubble:
      - create e@wither_skull[velocity=0,0,0] chatbubblecarrier <player.location> save:chatbubblecarrier
      - create e@slime[size=-2;velocity=0,0,0;custom_name=<player.flag[lastchat]||>;custom_name_visibility=true] '<&b>' <player.location> save:chatbubble
      - execute as_server 'npc select <entry[chatbubble].created_npc.id>'
      - execute as_server 'npc size -2'
      - mount <entry[chatbubble].created_npc>|<entry[chatbubblecarrier].created_npc> <player.location.add[0,2,0]>
      - flag chatbubble:<entry[chatbubble].created_npc>
      - flag chatbubblecarrier:<entry[chatbubblecarrier].created_npc>
lumichatbubbleloop:
  type: task
  debug: false
  script:
    - ^foreach <server.list_online_players> {
      - ^if <%value%.flag[chatbubble].as_npc.name.substring[1,60]||> != <%value%.flag[lastchat].strip_colors.substring[1,60]||> rename npc:<%value%.flag[chatbubble].as_npc> "<%value%.flag[lastchat]||<&e>>"
      }
    - ^foreach <server.list_online_players> {
      - ^mount <%value%.flag[chatbubble].as_npc>|<%value%.flag[chatbubblecarrier].as_npc> <%value%.location.add[0,3,0]>
      }
    - run lumichatbubbleloop delay:1t




Comments
2014-07-05 09:23:21 - jimfoxer:

I tried out your script, but it didn't work well for my server. I removed it, but now everytime I start my server there is an indestructible slime on the ground (other than a /killall command). Any way to remove this?
2014-07-08 03:19:50 - beecee:

@jimfoxer, this is a citizens npc, remove it like any other. If your script didn't work you're more than likely on a denizen version lower than the required one (1479).
2014-07-08 03:22:04 - beecee:

@jimfoxer, this is a citizens npc, remove it like any other. If your script didn't work you're more than likely on a denizen version lower than the required one (1479).