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.

Solved spawn mob at specific location

Discussion in 'Skript' started by Delano, Apr 26, 2018.

Thread Status:
Not open for further replies.
  1. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    So I made a code so a spider would spawn every 3 minutes at a variable and despawn after those 3 minutes and repeat.
    This is my code:
    Code (Skript):
    1. every 180 seconds:
    2.     spawn a spider at {Spider.Spawner.level.1::*}
    3.     wait 180 seconds
    4.     despawn spider
    5.     spawn a spider at {Spider.Spawner.level.1::*}
    But is doesn't work because skript doesn't recognize despawn.
    and even when I only spawn a spider at that location the spider doesn't spawn.
     
  2. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    I think this will work:
    Code (Skript):
    1. every 3 minutes:
    2.     spawn a spider at {Spider.Spawner.level.1::*}
    3.     set {_s} to last spawned spider
    4.     wait 3 minutes
    5.     set health of {_s} to 0
     
  3. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    hm.. The spider spawning works but they won't dissapear. they only keep spawning...
    But thanks for the working code for spawning though
     
  4. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    Oh I thought setting the health to 0 wouldn't drop his items. Well then this code will probably work:
    Code (Skript):
    1. every 3 minutes:
    2.     spawn a spider at {Spider.Spawner.level.1::*}
    3.     set {_s} to last spawned spider
    4.     set metadata "nodrops" of {_s} to true
    5.     wait 3 minutes
    6.     kill {_s}
    7.    
    8. on death:
    9.     victim is set
    10.     metadata "nodrops" of victim is true
    11.     delete drops
    but it does require Skellett
     
  5. Delano

    Delano Member

    Joined:
    Apr 15, 2018
    Messages:
    17
    Likes Received:
    2
    It works, thanks!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...