So in ballistic mode you have a primary(ar/smg/shotgun/sniper), a secondary(pistol) weapon and you can keep only one type of each.
How can I make so when you pickup a weapon it drops the other one that you have of the same type? Is there a setting that I did not found yet or I have to make the system from scratch. If so how can I detect what item I picked up? Or how do I manage player inventory in general?
The Item Remover Device, I haven’t used it yet so I’m not sure, but you may be able to add one to each weapon pickup that removes any weapons you assign to it.
That would be a hassle to do, you’d need to implement your own on ground item model, because when picked up, the weapon will replace the currently held weapon
Which means you’d need to keep an array of all currently held weapons to see if it triggered a wrong category weapon drop and place the weapon back into the inventory while removing the other category weapon
Example:
- Player has AR1 / SMG1 / SG1
- Save that array on a loop using conditional buttons
- Player picks up AR2 while holding SMG1
- You would need the dropped AR2 to be coming from an item spawner so that you can use the ItemPickedUpEvent()
- When picked up, detect that the player actually lost its SMG
- Because player has now two AR, you need to drop the AR1 using an item remover
- Place the SMG1 back into inventory
And I’m not sure if it’s even safe to do, it means you’d need to drop the weapons yourself upon death because you need item spawners to drop them, also not sure how it would behave in terms of which item will be equipped at the end of the process
There’s probably another way using a custom script but I’m really lazy to think about it rn, it seems like a bad idea to me