how to code the name contain "test" help me please XD

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

Phoom

New Member
Oct 27, 2020
5
0
1
23
this is my code but I want to change the lore to name contains "____"
but it's error so do u guys have any idea

on armor equip:
if lore of player's helmet contains "&b&l&nTest":
execute console command "/say %player% test3"
 
Uhm, I dont know much of Skript myself yet, but I dont believe there is an event for equiping items/armor.
Or im blind and it is on this website ( http://en.njol.ch/projects/skript/doc/events ), but I cant find it.

I tested around a bit, and this code would do what you want I think:

Code:
command /helmet:
    trigger:
        give diamond helmet with lore "&b&l&nTest" to the player

on right click:
    if player is holding a diamond helmet with lore "&b&l&nTest":
        message "%player% test3" to the player

Only if you equip armor by clicking with your right mouse button though. But it might be a start to what you need?
 
on armor equip:
wait 10 ticks
if player's helmet slot = diamond helmet:
if name of player's helmet = "&9Miner Helmet":
execute console command "/say %player% test3"
thanks for your ans but I think I slove it one step but I don't know how to change if name to if name contain cuz I have upgrade system every time my item's got upgade the name will change to Miner helmet (+1 to 10) so I would like the Skript to focus on only Miner helmet name do u have any idea
[doublepost=1610818672,1610818629][/doublepost]
Uhm, I dont know much of Skript myself yet, but I dont believe there is an event for equiping items/armor.
Or im blind and it is on this website ( http://en.njol.ch/projects/skript/doc/events ), but I cant find it.

I tested around a bit, and this code would do what you want I think:

Code:
command /helmet:
    trigger:
        give diamond helmet with lore "&b&l&nTest" to the player

on right click:
    if player is holding a diamond helmet with lore "&b&l&nTest":
        message "%player% test3" to the player

Only if you equip armor by clicking with your right mouse button though. But it might be a start to what you need?

on armor equip:
wait 10 ticks
if player's helmet slot = diamond helmet:
if name of player's helmet = "&9Miner Helmet":
execute console command "/say %player% test3"
thanks for your ans but I think I slove it one step but I don't know how to change if name to if name contain cuz I have upgrade system every time my item's got upgade the name will change to Miner helmet (+1 to 10) so I would like the Skript to focus on only Miner helmet name do u have any idea
 
does "On armor equip:" work for you? It doesn't for me. What addon's do you use exacly?

/sk info
[doublepost=1610820531,1610820409][/doublepost]Also, when you have a code, please put in a code box (not sure if that is the official name).

upload_2021-1-16_19-8-12.png


upload_2021-1-16_19-8-51.png


I think your code works fine, exept the on armor equip doesn't work for me, so I cant really help you right now.
 
Status
Not open for further replies.