[Closed] Launching a boat that a player is riding

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

CustomWorldYT

Member
Jun 17, 2018
15
0
0
Skript Version (do not put latest): Skript 2.3.5 (from GitHub)
Skript Author: bensku
Minecraft Version: 1.13.2
---
So, I'm trying to create a boat-race plugin (where you drive on the ice). The trouble is, that when a boat meets higher terrain, it obviously can't just "climb it up". So I have decided to make some kind of "boat launch pads" which should launch boats upwards. The problem is, that the boat isn't launched. For test purposes, I have created a simple dummy script to test, if it could work:
Code:
on vehicle enter:
    set {_%player%.boat} to event-entity
    broadcast "vehicle set"
    stop

on step on redstone block:
    push {_%player%.boat} upwards at speed 1
    broadcast "pushed"
    stop
 
command /push:
    trigger:
        push {_%player%.boat} upwards at speed 1
        broadcast "pushed"
        stop

The "pushed" message is for debugging purposes, to see if the event is actually triggered. When the player in a boat meets a redstone block, the message is sent, however, the boat isn't launched, as it should work. I already heard that boats are "delicious" entities when it comes to manipulating with them. I have tried to search on the internet, but I found nothing. I ask if I can actually make a working "boat-pads" or if it's possible. If not, I guess that I will need to make horse-racing instead.

Errors on Reload:
  1. An entity cannot be saved, i.e. the contents of the variable {%the player%.boat} will be lost when the server stops. (script.sk, line 2: set {%player%.boat} to event-entity')
I said it's a test script. And the boat should be saved as soon as the server doesn't stop, right?

Console Errors: (if applicable)
  1. No errors.

Other Useful Info:


Addons using (including versions):
No addons used.

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I have tried to create a "/push" command, pushing the player upwards, but this didn't work either.
 
Last edited:
Variables that start with an underscore are local variables, as in local to the event.
So you are setting variables, that are deleted after the event
 
Thanks for advice, Shane, however the boat is still not launched, even if I removed the underscores in the variables. I also tried to modify my script a little, currently it looks like this:

Code:
command /boat:
    trigger:
        spawn boat at player's location
        set {%player%.boat} to last spawned entity
 
command /push:
    trigger:
        push {%player%.boat} upwards at speed 1
        broadcast "pushed(?)"
        stop
 
command /purgeboat:
    trigger:
        delete {%player%.boat}
        message "purged"
        stop
 
on step on redstone block:
    push {%player%.boat} upwards at speed 1
    broadcast "(hopefully) pushed"
    stop

This code doesn't work either, and no errors or warnings were shown. The "/push" command doesn't work too.

Edit: I also tried this test script, but it works only for minecarts:

Code:
on right click:
    cancel event
    push player's vehicle upwards with speed 1

This might be a possible bug in Skript, so I'm creating a report at GitHub as well.
[doublepost=1550926109,1550670355][/doublepost]Another edit: Developers believe, that this is a Minecraft limitation, so I think, that I will use some other vehicle instead.

Final Edit:
For those looking for a good Skript vehicle system, I have found this piece of code:
The minecart is quite slow, but this is enough for me:
Code:
on right click with minecart:
make the player ride a minecart
    while player's vehicle is set:
        push player's vehicle in horizontal direction of player at speed 0.8
 
Last edited:
Status
Not open for further replies.