Capping the amount of item that can currently be spawned via item spawner

How can I cap an Item Spawner to stop spawning when it gets to a certain amount of items?

Basically what im trying to do is cap the amount of diamonds that can spawn to 6, 1 diamond per spawn.

Then when the item spawner gets to 6 diamonds currently spawned, it pauses the item spawner until a player picks up the diamonds.

Preciate Any Help!

You should be able to loop something this in Verse

Spawn a diamond → On Item Picked Up → Check if spawned 6 times in Verse → Spawn a diamond or pause

Sorry but could you explain a little further on how I check to see if its spawned 6 times?

That would be the main concept

var SpawnCount : int = 0

set SpawnCount += 1

if(Mod[SpawnCount, 6] = 0):
    # pause
1 Like

Hey! I was searching around for an answer because I had the same question, and I couldn’t find one - so I figured I’d respond with how I got it done!

It’s actually very simple.

You’ll need:

  • Item Spawner
  • Trigger
  • Timer Device

Set the item spawner to:

Enabled at start :white_check_mark:
Spawn on timer :x:
Respawn on timer :x:
Items Respawn :white_check_mark:
Run over pickupâś…
Allow spawning when blockedâś…
Continuously Spawnâś…

SPAWN ITEM on TRIGGER ACTIVATION

Set the trigger to:
Enabled at Game Start :white_check_mark:
Triggered by Sequencers :white_check_mark:
:x::x:Disable all others​:x::x:
Activate on phase: None
Times Can Trigger: (Amount of times you want to spawn. If you want to spawn 6 diamonds, and 1 diamond comes out of the item spawner each time it spawns - you’ll want to set “times can trigger” to 6)
Trigger Delay: 0
Reset Delay: 0

RESET TIMES TRIGERED: Item Spawner → On Item Picked Up
TRIGGER: Timer Device → On Success

ON TRIGGERED: Item Spawner → Spawn Item

Set the Timer Device to:
Duration (How frequently you want items to spawn)
Count Down Direction: Count Down
Start at Game Start :white_check_mark:
Can Interact :x:
Success on Timer End :white_check_mark:
Completion Behavior: Restart
Display Time In: Seconds Only

ON SUCCESS:
Trigger → Activate

Then - if you want the spawning to increase in speed as time goes on, just disable the timer and enable another timer at a specific trigger in the game “Time Elapsed”

I just tested it all and it works!