Pets

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

ErkS

Member
Dec 24, 2017
40
0
6
Why pet won't teleport to player?

Code:
on teleport:
    loop all entities:
        if name of loop-entity is "Haustier von %player%":
            if distance between player and loop-entity is less than 15:
                if distance between player and loop-entity is bigger than 3:
                    make loop-entity pathfind to location of player with speed 1.3
                else if distance between player and loop-entity is bigger than 15:
                    teleport loop-entity to position of player
                if world of player is not world of loop-entity:
                    teleport loop-entity to position of player

command /petMenu:
    trigger:
        open chest with 1 rows named "&6Petauswahl" to player
        format slot 0 of player with wolf spawn egg named "<grey>Pet: &2Wolf" to close then run "pet %player% Wolf"
        format slot 2 of player with horse spawn egg named "<grey>Pet: &2Pferd" to close then run "pet %player% Horse"

command /pet <player> [<entity type>]:
    permission: sk.admin
    trigger:
        while health of {pet1.%arg 1%} is more than 0:
            stop
        spawn arg 2 at arg 1
        wait 5 ticks
        tame last spawned entity to arg 1
        set {pet1.%arg 1%} to spawned entity
        set display name of spawned entity to "Haustier von %arg 1%"
 
Status
Not open for further replies.