Check if player is riding in a boat

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Andreas

Member
Mar 28, 2020
20
0
1
55
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"
 
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"
I dont know if this will help you:
code_language.skript:
on vehicle enter:
    event-entity is a boat
    set {vehicle.%player%} to "boat"
on vehicle exit:
    event-entity is a boat
    delete {vehicle.%player%}

every a minute:
    loop all players:
        if {vehicle.%loop-player%} is "boat":
            send "You're on a boat" to loop-player
 
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:
%entity% is rding

To get the vehicle, use this expression:
Code:
player's vehicle
vehicle of player

Here is an example in code
Code:
on vehicle enter:
    set {_vehicle} to player's vehicle
    send "You are ridding %{_vehicle}%"
 
  • on vehicle enter:
  • set {_vehicle} to player's vehicle
  • send "You are ridding %{_vehicle}%"

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:
 
Last edited:
Status
Not open for further replies.