1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What's wrong here?

Discussion in 'Requests' started by Twooze, Jun 12, 2019.

  1. Twooze

    Twooze Member

    Aug 13, 2018
    Likes Received:
    Quick and basic intro - I'm creating a skript to create a pet name "Orbix" that follows you around, but I can't get the command to remove the pet to work. It simply doesn't do anything. Here's my code:

    Code (Text):
    1. command /orbixon:
    2.     trigger:
    3.         spawn an armor stand at location behind the player
    4.         set {_orb.%player%} to spawned armor stand
    5.         add "{CustomNameVisible:1,NoGravity:4b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,DisabledSlots:2039583}" to nbt of {_orb.%player%}
    6.         set name of spawned armor stand to "&7%player%&7's &b&lOrbix"
    7.         set {_head} to "Variable" parsed as offlineplayer
    8.         set helmet of spawned armor stand to skull of {_head}
    9.         while {_orb.%player%} is alive:
    10.             if distance between player and {_orb.%player%} is greater than 1:
    11.                 teleport {_orb.%player%} behind the player
    12.             wait a tick
    14. command /orbixoff:
    15.     trigger:
    16.         delete {_orb.%player%}
    17.         send " "
    18.         send "&7&oOrbix transfers his essence into your body as he dissapears..." to player
    19.         send " "
  2. ShaneBee

    Resource Staff Supporter + Addon Developer

    Sep 7, 2017
    Likes Received:
    Use the help forum, this forum is called the request forum, for requesting people to write scripts for you.
    --- Double Post Merged, Jun 12, 2019, Original Post Date: Jun 12, 2019 ---
    Also to answer your question you have a few issues
    1) You are using a local variable, which is local to the event it was initiated in, meaning you can access it in another event/trigger (your command to turn it off)
    2) `delete {_orb.%player%}` <-- once you fix the local variable issue, this code here will just delete the variable itself, not what the variable holds, you might want to try `kill {var}`
    • Agree Agree x 2