Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ChatFAQ by 8bitfusion!
- #This skript should do nicely to stop people who didn't read the post!
- command /chatfaq <text> <text> [<text>]:
- permission:skript.op
- trigger:
- if arg-1 is "add":
- if arg-2 is not "add", "remove" or "reset":
- set {FAQs::%arg-2%} to arg-2
- message "<orange>Added %arg-2% to Frequently Asked Questions!"
- else:
- message "<red>You cannot use a keyword as an FAQ name!"
- else if arg-1 is "remove":
- if {FAQs::%arg-2%} is set:
- remove arg-2 from {FAQs::*}
- delete {Keywords.%arg-2%::*}
- delete {Text.FAQ::%arg-2%}
- message "<orange>Removed %arg-2% from Frequently Asked Questions!"
- else if arg-1 is "settext":
- if {FAQs::%arg-2%} is set:
- if arg-3 is set:
- set {Text.FAQ::%arg-2%} to arg-3
- message "Text %arg-3% added to FAQ %arg-2%!"
- else:
- message "<red>You must define the text!"
- else:
- message "<red>No FAQ exists with name %arg-2%!"
- else if arg-1 is "formattext":
- if {FAQs::%arg-2%} is set:
- if arg-3 is set:
- set {Text.FAQ::%arg-2%} to "§%arg-3%%{Text.FAQ::%arg-2%}%"
- message "§%arg-3%%arg-2%’s text will look like this!"
- else:
- message "<red>You must define the formatting code!"
- else:
- message "<red>No FAQ exists with name %arg-2%!"
- else if arg-1 is "addkeyword":
- if {FAQs::%arg-2%} is set:
- if arg-3 is set:
- set {Keywords.%arg-2%::%arg-3%} to arg-3
- message "<orange>Keyword %arg-3% added to FAQ %arg-2%!"
- else:
- message "<red>You must define the formatting code!"
- else:
- message "<red>No FAQ exists with name %arg-2%!"
- else if arg-1 is "resetkeywords":
- if {FAQs::%arg-2%} is set:
- delete {Keywords.%arg-2%::*}
- message "<orange>Keywords for %arg-2% have been reset!"
- else:
- message "<red>No FAQ exists with name %arg-2%!"
- else if arg-1 is "reset":
- loop {FAQs::*}:
- delete {Keywords.%{FAQs::%loop-value%}%::*}
- delete {Text.FAQ::*}
- delete {FAQs::*}
- message "<orange>All FAQs have been reset!"
- on chat:
- loop {FAQs::*}:
- loop {Keywords.%{FAQs::%loop-value%}%::*}:
- if "%message%" contains "%loop-value-2%":
- cancel event
- message "%{Text.FAQ::%loop-value-1%}%"
- exit loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement