Ever wanted to make players drop items that heal you when you pick them up? If that’s the case, check out this guide!
Knockout Manager x1
Item Granter x1
Health Granter x1
Place down a knockout manager device, which will help our player drop the item.
Next, go to “items” in the settings of the knockout manager, and use these settings (you can use any item for dropped items, I just used med packs for convenience):
What this will do is make it so that when a player is knocked out, a med pack spawns on their death location.
What we next want to do is check if a player has a med pack in their inventory, and grant them health if they do so. How can we do this? Checkers! We also need to constantly check if a player has the item in their inventory, so let’s also use a repeater to do so.
Place down a repeater device and a checker device.
Let’s configure the repeater first, which will repeat every 0.5 seconds. In order to make it start checking at the start of the game, let’s place down a lifecycle and a relay! No options need to be configured, just wire the lifecycle to the relay, and the relay to the repeater like this:
Event occurs → Relay Trigger
Relay Trigger → Start Repeater
In order to make it so that the repeater never stops, we can use this setting:
Basically, a channel that will never be broadcasted will stop the repeater.
Now, let’s place down a checker device. Nothing fancy, it should only run one check. We want to check if a player has >0 med packs, so let’s do that!
To actually grant health to the player, let’s place down a health granter device. It should heal your player how much health you want it to heal, for me I did 60 health and shield:
We also want to make it so that the player loses the medkit after this check to prevent infinite heals. Place down an item granter device, and set it to grant -1 of your dropped item:
We are now at the final part of our device system! Wire the repeater to the checker, the checker to the health granter, and the checker also to the item granter like this:
Repeater runs task → Run Check
Check passes → Grant Player Health
Check passes → Grant Player Item
That’s another asset to battle royale games! Thank you!