Solved Something weird occured

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

BoxMiners

Member
Jul 19, 2022
47
0
6
18
i was skripting smth when you rightclick on an npc it opens a gui. I copy pasted a skript from another npc that worked onto this, but it doesnt work anymore, does anyone know why?

on rightclick on entity:
if name of entity is "&6Ability Merchant":
open chest with 4 rows named "&6Abilty Merchant" to player
wait 3 ticks
 
1690889740771.png
it worked when i removed the "if name of entity is" so its for sure something with that, i just can't figure out what it is
 
Instead of using &6 for the color code, try using &a or &e. It doesn't look like gold. If you don't want to worry about color codes, you can write something like:
Code:
if name of event-entity contains "Ability Merchant":
    #do code here
 
its so weird it still doesnt work, idk why
Instead of using &6 for the color code, try using &a or &e. It doesn't look like gold. If you don't want to worry about color codes, you can write something like:
Code:
if name of event-entity contains "Ability Merchant":
    #do code here
its so weird idk why it still doesnt work
 
hey! can I give a reccomendation. if your using citizens dont do this. you could name a sheep that and it'll think it's the merchant. You can make a command that opens the GUI, because citizens already has it built in so if you click an NPC it can run a command for you. Here's a tutorial:
1. Look at the desired NPC
2. Run /npc select
3. Run /npc cmd add -p (your command but dotn include the slash, if you want it to be left click you could also add -l after the -p)
4. You're done!
(If it doesnt work check if PVP is enabled in the area, to disable real PVP use this skript)
Code:
on damage:
  victim is player:
    world is "world":
      cancel event
 
Also, I had this same problem, if you click an NPC entity is does nothing, since a npc click event is called an NPCClickEvent and that's in API only, so that's why it only wroks if you do /npc cmd add
 
hey! can I give a reccomendation. if your using citizens dont do this. you could name a sheep that and it'll think it's the merchant. You can make a command that opens the GUI, because citizens already has it built in so if you click an NPC it can run a command for you. Here's a tutorial:
1. Look at the desired NPC
2. Run /npc select
3. Run /npc cmd add -p (your command but dotn include the slash, if you want it to be left click you could also add -l after the -p)
4. You're done!
(If it doesnt work check if PVP is enabled in the area, to disable real PVP use this skript)
Code:
on damage:
  victim is player:
    world is "world":
      cancel event
Thank you so much it worked