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.

Prevent an armor stand being placed.

Discussion in 'Skript' started by Naxxos, Nov 28, 2017.

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

    Naxxos New Member

    Joined:
    Apr 14, 2017
    Messages:
    8
    Likes Received:
    0
    Hi all, I have been experiencing some trouble trying to prevent an armor stand being placed based on a permission granted to a player. here is the code:

    Code (Skript):
    1. on place of 416:
    2.         player has permission "magicspells.cast.vampireconsume":
    3.                 cancel event
    4.                 message "&cvampires may not place this block."
    5.                 stop
     
  2. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    elaborate. what doesnt work? are there errors? btw you dont need the stop at the end and you shouldnt really use ids
     
  3. Naxxos

    Naxxos New Member

    Joined:
    Apr 14, 2017
    Messages:
    8
    Likes Received:
    0
    The armor stand will just be placed,in other words literally nothing seems to happen.There is no message sent and no attempt to stop the block from being placed. The only error I get is one telling me data values may not be supported later on. Im using the ID's because I dont know where to find accurate names for the blocks/items.

    This is said error:
    [16:41:53 WARN]: [Skript] Using an ID instead of an alias is discouraged and will likely not be supported in future versions of Skript anymore. Please replace '416' with e.g. 'armor stand'. (Vampireblock.sk, line 211: on place of 416:')
     
  4. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    The names are found in the alias file in the skript folder

    As for the actual problem, i dont see anything wrong with the actual code so im guessing you just dont have the permission. Double check to make sure you spelled it right and you could also place a broadcast before the condition to make sure the event is firing
     
  5. Naxxos

    Naxxos New Member

    Joined:
    Apr 14, 2017
    Messages:
    8
    Likes Received:
    0
    I have done as you asked, and it does not seem the event is triggering here is the code:

    Code (Skript):
    1. on place of armor stand:
    2.         player has permission "magicspells.cast.vampireconsume":
    3.                 broadcast "Test"
    4.                 cancel event
    5.                 message "&cvampires may not place this item."
    I tested this with the data value and the alias, neither event triggered and the alias gave me an error:
    [17:02:42 ERROR]: can't understand this event: 'on place of armor stand' (vampireblock.sk, line 211: on place of armor stand:')
    [17:02:42 INFO]: [Skript] Encountered 1 error while reloading vampireblock.sk!

    I can confirm I have the permission.
    Armor stand couldent be found in the alias folder aswell.
     
    #5 Naxxos, Nov 28, 2017
    Last edited: Nov 28, 2017
  6. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    You didnt put the broadcast before the condition. Place it above the 'player has permission' line. also whats your skript and server version
     
  7. Naxxos

    Naxxos New Member

    Joined:
    Apr 14, 2017
    Messages:
    8
    Likes Received:
    0
    Still nothing. Server version is 1.12, skript version is the latest version.

    code:

    Code (Skript):
    1. on place of armour_stand:
    2.         broadcast "&cfml"
    3.         player has permission "magicspells.cast.vampireconsume":
    4.                 cancel event
    5.                 message "&cvampires may not place this item."
     
  8. White

    White Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    445
    Likes Received:
    25
    Because armor stands are an entity, not a block. Use on summon event.
     
  9. Naxxos

    Naxxos New Member

    Joined:
    Apr 14, 2017
    Messages:
    8
    Likes Received:
    0
    On summon was not recongnized. Found out there is an addon for skript (mundosk) that allows for an on armor stand place event, the event now triggers and the broadcast goes through however it does not prevent the stand from being placed
    code:

    Code (Skript):
    1. armor stand place:
    2.         broadcast "&cfml"
    3.         player has permission "magicspells.cast.vampireconsume":
    4.                 cancel event
    5.                 message "&cvampires may not place this item."
     
  10. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    its on spawn https://bensku.github.io/Skript/events.html#spawn
     
  11. Pikachu

    Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    139
    Medals:
    just cancel the right click event
     
    • Agree Agree x 1
  12. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    On armorstand place: doesn't have a player in THE event
     
Thread Status:
Not open for further replies.

Share This Page

Loading...