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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

/spawnmob -ish type of command help

Discussion in 'Skript' started by Deleted member 6377, May 4, 2018.

Thread Status:
Not open for further replies.
  1. Skript Version: Skript 2.2 (dev20c)
    Skript Author: Bensku
    Minecraft Version: 1.8.9
    ---
    Full Code:

    Code (Skript):
    1. command /creeper [<text>]:
    2.     permission: creeper.use
    3.     permission message: &cNo permission!
    4.     Usage: &c/creeper
    5.     executable by: players
    6.     trigger:
    7.         if arg-1 is not set:
    8.             spawn 1 creeper
    9.             send "&d1 &bCreeper spawned."
    10.         else:
    11.             spawn %arg-1% creeper
    12.             send "&d%arg-1% &bCreepers spawned."


    Basically if you don't understand this I'm trying ot make a command where if you type /creeper it will spawn a creeper at your location and if you put a number after /creeper (/creeper 10) it will spawn that number (10) of creepers.

    Errors on Reload:

    Code (Skript):
    1. [00:58:49 ERROR]: '%arg-1% creeper' is not an entity type (creeper.sk, line 12: spawn %arg-1% creeper')
    2.  
    Other Useful Info:

    Addons using (including versions):
    SkRayFall 1.9.3
    sKQuery 3
    Troubleshooting:

    Have you tried searching the docs? Yeah
    Have you tried searching the forums? Well, Google
    What other methods have you tried to fix it? Trying %arg 1%, arg 1, argument, <player>, <amount>, <number>

    I also tried doing the Loop thingy but I'm still a Skript noob so I'm not good at it. I tried to make it so the server loops the 'spawn 1 creeper' %arg-1% amount of times but that didn't work ;P
     
  2. Snow-Pyon

    Snow-Pyon Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,235
    Likes Received:
    176
    Medals:
    1. You only use percent signs within texts ("this is a text") to parse expressions.
    2. The argument type has to be "number" or "integer" for it to work.
    2. You just have to put an "of" between the amount and the entity type (creeper in this case). Of course, this won't work either way if you didn't do what #2 says.
     
  3. Uhhhhh

    Code (Skript):
    1. command /ecreeper <number>:
    2.     permission: creeper.ecreeper
    3.     permission message: &cNo permission!
    4.     Usage: &c/creeper
    5.     executable by: players
    6.     trigger:
    7.         if arg-1 is not set:
    8.             spawn 1 creeper
    9.             send "&d1 &bCreeper spawned."
    10.         else:
    11.             spawn %arg-1% of creeper
    12.             send "&d%arg-1% &bCreepers spawned."
    ??

    Idk how to use these <number> and other stuff cause it doesn't say anywhere
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    like Snow said, " You only use percent signs within texts ("this is a text") to parse expressions."
    So change your
    "spawn %arg-1% of creeper" to "spawn arg-1 of creeper"

    For info on numbers check HERE
    For info on arguments in commands, check HERE
     
  5. I did that. Thanks, there are no more errors in the Skript. But If I type /creeper, it spawns one creeper. When I type a number after it, all it does is say in chat "4 Creepers spawned." etc.
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Can you send the whole updated code so I can see exactly what you got. Thanks
     
  7. Code (Skript):
    1.  
    2. command /creeper [<number>]:
    3.     permission: creeper.use
    4.     permission message: &cNo permission!
    5.     Usage: &c/creeper
    6.     executable by: players
    7.     trigger:
    8.         if arg-1 is not set:
    9.             spawn 1 creeper
    10.             send "&d1 &bCreeper spawned."
    11.         else:
    12.             spawn arg-1 of creeper
    13.             send "&d%arg-1% &bCreepers spawned."
    14.  
     
  8. Runakai

    Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Here is the "Loop Thingy" you were trying to do:

    Code (Skript):
    1.  
    2. command /creeper [<number>]:
    3.     permission: creeper.use
    4.     permission message: &cNo permission!
    5.     Usage: &c/creeper
    6.     executable by: players
    7.     trigger:
    8.         if arg-1 is not set:
    9.             spawn 1 creeper
    10.             send "&d1 &bCreeper spawned."
    11.         else:
    12.             loop arg-1 times:
    13.                 spawn a creeper
    14.             send "&d%arg-1% &bCreepers spawned."
    Well anyway your code does work for me. [Not the "Loop Thingy" one
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I just tested it, and I have no issues.
    I did /creeper and 1 creeper spawned,
    I did /creeper 10 and 10 creepers spawned

    Then again I am not testing on 1.8.9.... But I don't see how it should be much different
    --- Double Post Merged, May 5, 2018, Original Post Date: May 5, 2018 ---
    UPDATE:
    I tested on 1.8.8 (not 1.8.9 because i didn't have one already set up)
    Also tested on Skript bensku 2.2 dev 20b because i couldn't find a dev20c anywhere

    Still works, same thing, /creeper got me 1 creeper and /creeper 10 spawned 10, no issues
     
  10. Hmm, maybe my Skript version is outdated. Anyway, thanks for your help!
    Ty !
     
    #10 Deleted member 6377, May 6, 2018
    Last edited by a moderator: May 6, 2018
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Im not really sure how yours could be outdated, as I used versions older than yours.
    Try removing some of your addons, I know certain old/outdated addons can cause issues
     
Thread Status:
Not open for further replies.

Share This Page

Loading...