Date: 2017/12/16 22:28:41 UTC-08:00
Type: Denizen Script
chatSwitcherHandler:
type: command
name: chatswitch
aliases:
- cswitch
debug: false
usage: /chatswitch
description: switches between roleplay and global chats
script:
- if !<player.has_flag[rolePlay]> {
- flag player rolePlay
- narrate "<&6>You are now in the roleplay chat channel."
}
else {
- flag player rolePlay:!
- narrate "<&6>You have left the roleplay chat channel."
}
chatSwitcher:
type: world
debug: false
events:
on player chats:
- if <player.has_flag[rolePlay]> {
- if <context.message.starts_with[*]> {
- determine passively "<&o>Whispers<&r> <context.message>"
}
else {
- determine passively "<&o>Says<&r> <context.message>"
}
- determine recipients:<server.get_online_players_flagged[rolePlay]>
}