I can't make players ride dragons

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

    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.

lukasvdb

Member
Jul 15, 2019
3
0
0
So i am making a dragon plugin which lets player hatch and ride dragons for my server but i can't make the player ride a dragon

This is the code of me trying to make them ride the dragon:

Code:
on right click on ender dragon:
    if name of clicked entity is "&c%player%'s dragon":
        make player ride clicked entity
        while vehicle of player is clicked entity:
            if block infront of player's vehicle is not air or tall grass or long grass:
                if block above block infront of player's vehicle is air:
                    push player's vehicle upwards at speed 0.2
            push player's vehicle in horizontal direction of player at speed 0.5
            wait 0.1 seconds


command /dragon-spawn:
    trigger:
        spawn ender dragon at location of player
        tame last spawned ender dragon to player
        set name of last spawned ender dragon to "&c%player% dragon"


if i do this nothing happens if i right click on the dragon and the name of the dragon also doesn't get set
 
Hi, your problem is very simple.

You put in /dragon-spawn command

Code:
"&c%player% dragon"

But, In the right click on ender dragon event you put

Code:
"&c%player%'s dragon":


"&c%player% dragon"
"&c%player%'s dragon"

This should work:
Code:
on right click on ender dragon:
    if name of clicked entity is "&c%player% dragon":
        make player ride clicked entity
        while vehicle of player is clicked entity:
            if block infront of player's vehicle is not air or tall grass or long grass:
                if block above block infront of player's vehicle is air:
                    push player's vehicle upwards at speed 0.2
            push player's vehicle in horizontal direction of player at speed 0.5
            wait 0.1 seconds
 
 
command /dragon-spawn:
    trigger:
        spawn ender dragon at location of player
        tame last spawned ender dragon to player
        set name of last spawned ender dragon to "&c%player% dragon"



(btw Sorry for my bad English)
 
Status
Not open for further replies.