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.

Block placing of player head with name

Discussion in 'Skript' started by Nikola, Mar 12, 2020.

Thread Status:
Not open for further replies.
  1. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
    Hi, I'm making custom food skript using heads (example: head looking like a Strawberry named "Strawberry"), and I need your help. I want to block placing of food heads, and I'm using this code:
    Code (Text):
    1. on place:
    2.     if event-block is head item:
    3.         set {_name} to name of player's tool
    4.         if "%{_name}%" is "&cStrawberry":
    5.             cancel event
    6.  
    There is no error. I think that error is in 2nd line, invalid item name. Can someone help me make this skript work? Again, I want to block placing of a item. Thank you all!
     
  2. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    429
    Likes Received:
    30
    Code (Text):
    1. on place of player skull:
    2.     if player's tool's name is "&cStrawberry":
    3.         cancel event
     
    #2 Goose, Mar 12, 2020
    Last edited: Mar 12, 2020
    • Useful Useful x 1
  3. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    don't forget about: player wall skull

    on place of player skull:

    Only detects with floor placements

    Code (Text):
    1.  
    2. on place of player skull or player wall skull:
    3.     if player's tool's name is "&cStrawberry":
    4.         cancel event
    5.  
     
    • Useful Useful x 1
  4. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    429
    Likes Received:
    30
    Good spot!
     
    • Like Like x 1
  5. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
    Thanks, but it still doesn't work. Using @Lego_freak1999's code gives me error in the picture, and @Goose's code gives me no errors, but still placing on the floor isn't blocked.
     

    Attached Files:

  6. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    What skript version u on? screen /ver skript
     
    • Like Like x 1
  7. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
     

    Attached Files:

  8. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    and what mc version u on? just /ver
     
    • Like Like x 1
  9. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
     

    Attached Files:

  10. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    Why u running sush an old version of skript?
     
  11. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
    I haven't updated it because some very important features for my skripts were changed in never ones..
     
  12. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    Yeah i feel u but u should update and fix those things with the new syntaxes. If u need any help with stuff not working after a update create a new help post or send me a dm. The longer u wait the more work it will be to update.
    --- Double Post Merged, Mar 13, 2020, Original Post Date: Mar 13, 2020 ---
    and did Goose method also let u place it on wall or did it block that
     
    • Agree Agree x 1
  13. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
    His method doesn't block anything, the one you've sent has error, skript doesn't recognize "player wall skull"
     
  14. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    Yeah i looked at the alliases it seems to be messed up got to have a better look at it
    --- Double Post Merged, Mar 14, 2020, Original Post Date: Mar 13, 2020 ---
    https://github.com/SkriptLang/skript-aliases/commit/7efad1a0b2a2b6a08660062ccaa618d20b356753#commitcomment-37821004
     
Thread Status:
Not open for further replies.

Share This Page

Loading...