1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Npc problem :(

Discussion in 'Skript' started by Frej Nielsen, Dec 8, 2019.

Thread Status:
Not open for further replies.
  1. Frej Nielsen

    Frej Nielsen Member

    Joined:
    Nov 8, 2019
    Messages:
    2
    Likes Received:
    0
    #I would be able to do so if you click the first time he talks to one, the second time just a menu will appear, but it does not work

    variables:
    {peter} = true

    on rightclick on a entity:
    if name of entity is "&6&lPeter":
    if {peter} is true:
    set {peter} to false
    execute console command "/effect %player% minecraft:slowness 600 10"
    message "&6&lPeter: &eFornøjelse at møde dem %player%"
    message "&6&lPeter: &eGodt jeg ikke står i dine sko.."
    wait 3 ticks
    message "&6&lPeter: &eNå men her kan du købe din frokost"
    wait 50 ticks
    execute console command "/effect %player% clear"
    else:
    open chest with 3 rows named "&6&lPeter &emadpak" to player
     
  2. ZeyKra_

    ZeyKra_ Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    109
    Likes Received:
    2
    First is u want to detect rightclick on npc you must us this event

    Code (Text):
    1. on npc right click:
    2.     if citizen is yournpcid:
    3.         #code
    4.         stop
    And don't use global variable because i think you want to do eat for each player so use .player or player's uuid variable like

    So use
    or
     
Thread Status:
Not open for further replies.
Loading...