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.

Solved Weird endeavor of the "on portal" event. Pls help.

Discussion in 'Skript' started by Allan Noyd, Jun 28, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    I'm trying to do it so specific players are not allowed in to the end dimension (they cannot go through the enderportal). As skript on my server has been protesting ever since the 1.18 update, I was going on it slowly. First code looked like this:
    Code (Text):
    1. on player portal:
    2.     broadcast "hi"
    And it worked. After going through a netherportal, it spit out "hi" in the chat.
    However then came the next step of adding conditions:
    Code (Text):
    1. on player portal:
    2.     player's display name is "AlienoidTv"
    3.     broadcast "hi"
    Nothing ever happened. No error. No chat message as coded. My user name is AlienoidTv just as in the code. Can anyone say what is going on? Thanks.

     
  2. Best Answer:
    Post #10 by mordrowned, Aug 8, 2022
  3. Sabified

    Sabified Member

    Joined:
    Jun 5, 2022
    Messages:
    46
    Likes Received:
    2
    You forgot a colon

    Code (Text):
    1.  
    2. on player portal:
    3.     player's display name is "AlienoidTv":
    4.         broadcast "hi"
    5.  
     
  4. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    Is this new? I never used colons after "simple" conditions (a.k.a. conditions without "if" statement) before and it used to work.

    Edit: Also, it does not work for me either. :/
     
    #3 Allan Noyd, Jul 26, 2022
    Last edited: Jul 26, 2022
  5. ViperX

    ViperX Member

    Joined:
    Jul 26, 2022
    Messages:
    26
    Likes Received:
    0
    this?
    Code (Text):
    1. if display name of event-player is "":
     
  6. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    I tried that too, but thanks for trying tho. At this point I just think Minehut is pranking me.
     
  7. ViperX

    ViperX Member

    Joined:
    Jul 26, 2022
    Messages:
    26
    Likes Received:
    0
    lol its need to work whats your skript info?
     
  8. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    What is Skript info? If you mean skript version, I have the latest version. If you mean error message, there's none.
     
  9. mordrowned

    mordrowned Member

    Joined:
    Apr 22, 2021
    Messages:
    40
    Likes Received:
    2
    If you want a command to make players not be able to go to the end.

    Code (Text):
    1. command /disableendaccess [<offline player>]:
    2.     permission: skript.disableend
    3.     trigger:
    4.         if arg-1 is set:
    5.             add arg-1 to {noendaccess::*}
    6.  
    7. on player portal:
    8.     if {noendaccess::*} contains player:
    9.         cancel event
    10.  
    Note: This means they also can't enter the nether if you don't want that you can do this


    Code (Text):
    1. command /disableendaccess [<offline player>]:
    2.     permission: skript.disableend
    3.     trigger:
    4.         if arg-1 is set:
    5.             add arg-1 to {noendaccess::*}
    6.  
    7. on player portal:
    8.     if {noendaccess::*} contains player:
    9.         if event-teleportcause is not nether portal:
    10.             cancel event
    11.  
     
  10. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    Hi. First of all, thank you for the help. My skript-testing server does not like the code for some reason, but imma write that off as Minehut being Minehut. Online parser says it cannot compare event-teleportcause with an item type, but who knows.

    Are you sure enderpearling won't get canceled too? It is a teleport cause (at least in my eyes and skript docs as far as I know) and it is not caused by nether portal.

    Second of all, what about the custom permission? Do I need a separate plugin for that? How do I get the permission in-game?

    Thanks once again for the help. A command was actually what I was going for, I just couldn't get it work so I was testing and nothing seemed to work.
     
  11. mordrowned

    mordrowned Member

    Joined:
    Apr 22, 2021
    Messages:
    40
    Likes Received:
    2
    You could maybe do
    Code (Text):
    1. If event-teleportcause is not “nether portal” parsed as teleport cause:
    About the ender pearl, even though it is a teleport cause, it doesn’t trigger the player portal event (as far as I know). That event only gets triggered by nether/end portal.
     
  12. Allan Noyd

    Allan Noyd Member

    Joined:
    Apr 29, 2021
    Messages:
    48
    Likes Received:
    0
    I see. Thank you.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...