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.

Check if player is riding in a boat

Discussion in 'Skript' started by Andreas, Mar 28, 2020.

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

    Andreas Member

    Joined:
    Mar 28, 2020
    Messages:
    20
    Likes Received:
    0
    I really want to create a script that checks if a player is in a boat and then sends a message. This is what i currently have but it isn't working.

    every second:
    if player is riding a boat:
    send "This is a test"
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I dont know if this will help you:
    Code (Skript):
    1.  
    2. on vehicle enter:
    3.     event-entity is a boat
    4.     set {vehicle.%player%} to "boat"
    5. on vehicle exit:
    6.     event-entity is a boat
    7.     delete {vehicle.%player%}
    8.  
    9. every a minute:
    10.     loop all players:
    11.         if {vehicle.%loop-player%} is "boat":
    12.             send "You're on a boat" to loop-player
    13.  
     
  3. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    Why using variables while skript has an expression for the vehicle which the player is riding ?

    This is a condition to check if an entity is
    riding a vehicle:
    Code (Text):
    1. %entity% is rding
    To get the vehicle, use this expression:
    Code (Text):
    1. player's vehicle
    2. vehicle of player
    Here is an example in code
    Code (Text):
    1. on vehicle enter:
    2.     set {_vehicle} to player's vehicle
    3.     send "You are ridding %{_vehicle}%"
     
  4. Andreas

    Andreas Member

    Joined:
    Mar 28, 2020
    Messages:
    20
    Likes Received:
    0
    I don't get any errors in console or sk reload, when i enter the boat i dont get any message.

    Edit:

    I have tried all the other vehicle variables (i think thats what they are called) and the only one that doesnt seem to work is on vehicle enter:
     
    #4 Andreas, Mar 31, 2020
    Last edited: Mar 31, 2020
Thread Status:
Not open for further replies.

Share This Page

Loading...