Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on script load:
- if "plugins/StaffChat/config.yml" does not exist:
- delete {config::*}
- create file "plugins/StaffChat/config.yml"
- if {config::zprefix} is not set:
- set yaml value "prefix" from file "../../StaffChat/config.yml" to "&7[&3StaffChat&7]"
- if {config::layout} is not set:
- set yaml value "layout" from file "../../StaffChat/config.yml" to "{prefix} &3{player}&7:"
- if {config::pmessage} is not set:
- set yaml value "permission message" from file "../../StaffChat/config.yml" to "&cNo Permission!"
- if {config::permission} is not set:
- set yaml value "permission" from file "../../StaffChat/config.yml" to "staffchat.use"
- set {config::permission} to yaml value "permission" from file "../../StaffChat/config.yml"
- set {config::layout} to yaml value "layout" from file "../../StaffChat/config.yml"
- set {config::zprefix} to yaml value "prefix" from file "../../StaffChat/config.yml"
- set {config::pmessage} to yaml value "permission message" from file "../../StaffChat/config.yml"
- replace all "&" with "§" in {config::zprefix}
- replace all "Â" with "" in {config::zprefix}
- replace all "\xa7" with "&" in {config::zprefix}
- replace all "\xbb" with "»" in {config::zprefix}
- replace all "&" with "§" in {config::layout}
- replace all "Â" with "" in {config::layout}
- replace all "&" with "§" in {config::pmessage}
- replace all "Â" with "" in {config::pmessage}
- replace all "{permission}" with "%{config::permission}%" in {config::pmessage}
- command /sc:
- aliases: /staffchat
- trigger:
- if player does not have permission "%{config::permission}%":
- message "%{config::pmessage}%"
- stop
- else:
- if {sc.%player%} is not set:
- message "%{config::zprefix}% &7Your staff chat has been toggled &a&lON&7!"
- set {sc.%player%} to true
- stop
- else:
- message "%{config::zprefix}% &7Your staff chat has been toggled &c&lOFF&7!"
- delete {sc.%player%}
- stop
- on chat:
- if {sc.%player%} is set:
- if player has permission "staffchat.use":
- cancel event
- loop all players:
- if loop-player has permission "staffchat.use":
- replace all "{prefix}" with "%{config::zprefix}%" in {config::layout}
- replace all "{player}" with "%player%" in {config::layout}
- message "%{config::layout}% %the message%" to loop-player
- stop
- else:
- delete {sc.%player%}
- stop
Add Comment
Please, Sign In to add comment