- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Random NPC Spawn


By Rosstail
Created: 2018/12/14 08:41:33 UTC-08:00 (5 years and 106 days ago)
Edited: 2019/01/02 06:50:49 UTC-08:00 (5 years and 87 days ago)
Likes: 0

Denizen Version: Version 1.0.2-SNAPSHOT (Build 289)
Script Version: 1.1
Description:

A litle script to spawn a random amount of existing npcs and replace them each hours. It keeps errors when a plyer isn't near from them.


Download script | View raw script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2800

spawn_random_npcs:
  type: task
  debug: false
  script:
    ################################################
    #CHOISIR LE NOMBRE MINIMUM ET MAXIMUM DE npcs
    - define min_npc 3.0
    - define max_npc 7.0
    #CHOISIR L'ID MINIMUM ET MAXIMUM 
    - define min_id 0
    - define max_id 29
    ################################################
    - flag server nb_npc_sp:<util.random.int[<def[min_npc]>].to[<def[max_npc]>]>
    - repeat <server.flag[nb_npc_sp]>:
      - define npc n@<util.random.int[<def[min_id]>].to[<def[max_id]>]>
      - spawn <def[npc]> <def[npc].location> persistent
      - run locally despawn_npcs delay:60m def:<def[npc]> 
  despawn_npcs:
    - despawn <def[1]>

actions_npcs:
  type: world
  debug: false
  events:
    on system time hourly:
    - run spawn_random_npcs instantly






View History