Random NPC Spawn
By
RosstailCreated: 2018/12/14 08:41:33 UTC-08:00 (6 years and 10 days ago)
Edited: 2019/01/02 06:50:49 UTC-08:00 (5 years and 356 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 scriptspawn_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