Change argument in options

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Nov 14, 2020
2
0
1
21
Hello, this might not make sense, but I want to make a simple "MessageColor" command.


options:
prefix: &7[&bSkyPR&7]&r
bcc: &c
chatcolor: &7


on chat:
if player is in group "default":
set {_rankp} to placeholder "prison_rt" from player
set message format to "%{_rankp}% &8[&7Default&8] &7%player% &6> {@chatcolor}%message%"

if player is in group "owner":
set {_rankp} to placeholder "prison_rt" from player
set message format to "%{_rankp}% &f[&c&lOwner&f] %player% &6> {@chatcolor}%message%"

if player is in group "builder":
set {_rankp} to placeholder "prison_rt" from player
set message format to "%{_rankp}% &f[&bBuilder&f] &7%player% &6> {@chatcolor}%message%"


command /messagecolor <text>:
trigger:
if arg 1 is set:
if arg 1 is white:
set chatcolor to &f
if arg 1 is gray:
set chatcolor to &7



Like that. you have any ideas if this could somehow work?
 
I'm not sure if you can change options arguments but you can set the chat color to a variable and change it that way. For example,

Code:
on load:
    {chatcolor} is not set
    set {chatcolor} to "&7"

on chat:
    set message format to "%player%:%{chatcolor}% %message%"

command /messagecolor <text>:
    trigger:
        arg-1 is "white":
            set {chatcolor} to "&f"
        arg-1 is "gray":
            set {chatcolor} to "&7"

By the way, asking whether arg-1 is white or gray requires quotation marks. ( "white" not white )
 
Last edited:
Status
Not open for further replies.