How to give players regen when they have an item (Difficulty: đźź© 3/10)

Start by adding an Inventory Item Manager and choosing an item that gives you regen. Make sure that it does not show an alert when someone collects the item.


It should look like this.
Then, create a new block and copy the code shown here.

What this does is it sets a property Regen to true if a player has the item. But right now that property is in the global scope, which will make it so that the region affects everyone. To fix this, add a Property device with property name Regen, and set the scope to player, and the type to true/false(Boolean for those with programming expertise). It should look like this.

Next, add a repeater. Set the interval to however long you want between heals(1.0 is good), and the stop strategy to when receiving on a channel. Do not set the channel, this way it will not stop. It should look like this.

Then add a lifecycle device. We will be using the default settings, so don’t bother modifying it. Connect a wire from it to the repeater, like so:

Now create a trigger device and make it not visible in game, not triggerable by collisions, and set the active scope to player. Connect the repeater to the trigger, like this:

Next, create a new block in the trigger and copy this code:

Finally, add a Health Granter, set “Grant health when receiving on” to Heal, and set the other settings to your liking. The finished device should look like this:

[poll type=regular results=always chartType=bar]
How difficult was this guide?

  • 1/10
  • 2/10
  • 3/10
  • 4/10
  • 5/10
  • 6/10
  • 7/10
  • 8/10
  • 9/10
  • 10/10
0 voters
6 Likes

Nice guide, @NextLevel !!

2 Likes

This is a really good guide!

Why is the difficulty rating so split?

1 Like

idk I voted for 3/10 myself

1 Like

Great guide, but there is already a help post on this

1 Like

Try an average poll!

Difficulty
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
0 voters
3 Likes

Why is “how difficult is this guide” an option?

1 Like

It was a normal poll for me

1 Like

You can choose the “How difficult was this guide” as an option. Try it right now.

1 Like

Why?

1 Like

Also 14% of voters think that the difficulty rating of this guide should be “how difficult is this guide”

3 Likes

Yes, I realize that.

1 Like

Nice guide! It always makes me smile to see pseudo teaming in use! Also, what does the last trigger do?

4 Likes

Nice guide
Do note you can choose “How Difficult is this guide” as an option, you can customize the title in the :gear: button in the bottom-right-corner.

1 Like

That sends the signal to the health granter. It’s my first guide so it’s neither polished nor well done

Nice guide! 2 things:

  • your poll is wonky, it has some random text above it and you can pick 5 options
  • you can use a checker for this (to simplify)
2 Likes

Um… that logic gate isn’t checking anything. It’s like saying, “If the sky, then there is oxygen.”

3 Likes

@ClicClac You are wrong (no offense). It does work, that is how booleans work. The place where you put your conditional in the if statement evaluates as true or false, and if true it will go. So, If (True) technically works.

3 Likes

? what do you mean, I think his solution works, since he starts the repeater on game start and needs to check if they have regen

1 Like

Nvm I didn’t read your post. I didn’t really know about that, that’s interesting.