How do you stop picking up weapons you already have?

I have an Item Spawner with a grenade launcher and limited ammo, along with several other weapons placed throughout the scene. Currently, to replenish ammo, the player must pick up another Item Spawner containing the same weapon. This adds another grenade launcher to their inventory instead of just refilling their ammo.

Is there a way to make the player pick up only the ammo if they already have the weapon?

Hey Dmytro! I’ll try to help you with this.

If you are using Creative, the best way I found is to replace the previous weapon with a new one.

To achieve that all you need to do is to link an Item Granter’s “Grant Item” function to each each Item Spawner “On Item Picked Up” event.

The Item Granter should include the weapon and ammo to grant and have the following values:
On Grant Action: Clear Items
Grant: All Items
Grant Condition: Only If Not Owned
Grant On Cycle: No
Equip Granted Item: Yes

For the Item Spawner you will only need to set the item to spawn, not the ammo, as you will using it just as a visual guide for the player.

Keep in mind that this setup will remove any other weapon from the player’s inventory and that you need to create and link Item Spawners and Item Granters for each different weapon you want to have in your island.

I highly recomend you to setup something like this (see the image below), so you only need to copy/paste the item spawners without the need to configure them one by one afterwards.

I hope I have been helpful!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.