Solved if event-entity's display name contains doesn't work with some names

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

MiiTsY

Member
May 27, 2022
41
1
8
26
Skript version : 2.6.2
Minecraft : 1.17.1
code:
Code:
on right click on entity:
    if event-entity's display name contains "&7Esquire &fMike":
        broadcast "Mike passed"
        make player execute command "/talknpc1"
    if event-entity's display name contains "&7Wineseller &fLewis":
        broadcast "lewis passed"
        make player execute command "/talknpc2"
     
command /talknpc1:
    cooldown: 5 seconds
    cooldown message:&0
    trigger:
        send "&a[&7Esquire &fMike&a] &aHey, this area ain't open to public!" to player
        wait 2 seconds
        send "&a[&7Esquire &fMike&a] &a...Hm ? You'd like to know If we need help on something ?" to player
        wait 4 seconds
        send "&a[&7Esquire &fMike&a] &aWell ... you see, we've been attacked by some rascals last night and we havn't catched em' yet." to player
        wait 5 seconds
        send "&a[&7Esquire &fMike&a] &aD'you think you'd be able to pull that off for us ? Also if you could get back the &4Ruby &athey stole, I'd be great!" to player
         
command /talknpc2:
    cooldown: 5 seconds
    cooldown message:&0
    trigger:
        send "&a[&7Wineseller &fLewis&a] &aHey, test" to player
Hello there ! I have a problem with the code above, I have 2 NPCs, one named &7Esquire &fMike and one &7Wineseller &fLewis.
But only &7Esquire &fMike for some reason triggers the /npctalk command assigned to it.
I tried to change the name of &7Wineseller &fLewis to name starting with the same initial of Mike (like &7E &fM) and it works. Its like some letters are blocked after a code color or something.
Does anyone know something about it or a fix etc?

I'd really appreciate any help ! Thanks.


Addons using (including versions):

skript-placeholders 1.5.2
skript-gui 1.3-beta2
skellet 2.0.7
skrayfall 1.9.28
skquery 4.1.6
updated to 1.17.1
skvault 2.0
[doublepost=1657809410,1657648988][/doublepost]I fixed it by just removing the color code in the code.
But that's just a temporary solution ..

FIXED complety, it seems like if display name is longer than 16 characters, it turns the name into something like CIT-Numbers.
So I used
Code:
    send event-entity's display name to player
to get its name and changed to it in the code
 
Last edited:
Status
Not open for further replies.