Solved Pathifind

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

MeHow

Active Member
Feb 6, 2017
140
13
18
Lithuania
I have problem, my pet don't pathifind :emoji_frowning:.
Code:
code_language.skript:
command /testpet:
    trigger:
        if player is op:
            spawn a pig
            set name of last spawned pig to "&d%player%'s Piggy"
            set {god.%entity%} to true
            add last spawned pig to {pig.%player%}
            
every 2 seconds:
    loop all players:
        set {lastloc.%loop-player%} to location of loop-player
        make {pig.%loop-player%} pathfind to {lastloc.%loop-player%} with speed 1
 
Instead of "adding" the pig to a single variable (which doesn't make sense and won't work), do "set {pig.%player%} to last spawned pig".

Note that entities stored in variables won't be stored across server restarts.
 
Status
Not open for further replies.