Solved Detect color from prefix

  • 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.

PuchiGFX

Member
Jan 26, 2017
246
5
18
How can i detect the color of a player's prefix?
i mean, instead of send "&4[OWNER]PuchiGFX" only send "&4PuchiGFX"
 
This isn't tested, but you could try something like this:

code_language.skript:
set {_prefix} to player's prefix
replace all uncolored player's prefix in {_prefix} with ""
send "%{_prefix}%%player's name%"

That should take their prefix and remove the actual textual part of it, leaving only the color codes. Then you can just append it to the front of their name.
 
This isn't tested, but you could try something like this:

code_language.skript:
set {_prefix} to player's prefix
replace all uncolored player's prefix in {_prefix} with ""
send "%{_prefix}%%player's name%"

That should take their prefix and remove the actual textual part of it, leaving only the color codes. Then you can just append it to the front of their name.
not working :-:
https://gyazo.com/f46a57b7389fa429c63dc8ed38e20b58
 
Then I do not think there is a very straightforward way. What does it send when you try that?
[doublepost=1487452055,1487451081][/doublepost]I just tested with your exact example and it worked fine for me. It won't work if there's color codes in the middle of the prefix, but with your example it should work fine.
 
Then I do not think there is a very straightforward way. What does it send when you try that?
[doublepost=1487452055,1487451081][/doublepost]I just tested with your exact example and it worked fine for me. It won't work if there's color codes in the middle of the prefix, but with your example it should work fine.
and why it isn't working for me?
pic: https://gyazo.com/cf5c9463bdbfe9c73d2a635bfdcb4250
 
OMG! It's easy, you have the solution in the home page.
Here you have the code:
code_language.skript:
command /test:
    trigger:
        send "%first 2 characters of coloured player's prefix%%player%"
 
  • Like
Reactions: PuchiGFX
Status
Not open for further replies.