I need help with a in-game health

I am making a map and I want it so that the player has to buy the food in order to not starve. I need help with 3 things

  1. I need to know how to make it so that the players health decreases unless it has eaten the food (watermelon)
  2. I need to know how to make it so that when the player eats the food (watermelon) it increases their health
  3. I need to know how to make it so that after the player eats the food its health decreases very slowly

When you reply please reply with the number of what your replying to for example 1. blah blah …

1 Like

Okay, I might be able to help. Give me a minute, @Claire_B .

1 Like

okay take all the time you need

unfortunately we cannot subtract health
the common solution is pseudo(fake) health
pseudo health is storing health in a property
for you this might work

1 Like

Okay Thanks I’ll check it out

JUST 2

Lifecycle, Relay, Checker, and 2 wire repeaters. Game start – all players — run check.
Checker: item amount, watermelon, greater than 0
Checker, wire repeater01: check passes – send pulse (0.1 seconds)
wire repeater01, checker: Received pulse run check
Checker, wire repeater02: check failed – send pulse (0.1 seconds)
wire repeater02, checker: Received pulse run check

(constantly check if a player has food)

get a game overlay
not active on game start, button, button overlay: “eat food,” scope: player

connect with previous wire repeaters 01, 02
01, game overlay: received pulse — show overlay,
02, game overlay: received pulse — hide overlay,

counter, property
Property: “Eat food” property scope: player
Counter starting value 0, scope: player, connected to property “eat food”

Overlay pressed:
item granter (-1 watermelon)
counter (increment)

Lifecycle, Relay, Checker, and 2 wire repeaters. Game start – all players — run check.
Checker: value of property, “eat food”, greater than 0
Checker, wire repeater03: check passes – send pulse (0.5 seconds)
wire repeater03, checker: Received pulse run check
Checker, wire repeater04: check failed – send pulse (0.5 seconds)
wire repeater04, checker: Received pulse run check

health granter: health, then shield, amount is 2

checker to health granter: check passes grant health

new wire repeater set to 10 seconds
game overlay, new wire repeater, counter: button pressed – send pulse, received pulse – decrement counter.

(I don’t have time to explain this, I need to go to class, trust me it works) tell me if it doesn’t… lol

2 Likes

yes u can
look
health granter, it can add NEGATIVE HEALTH

It cannot. [1]


  1. Unless I missed a huge update… But that raises the question: why didn’t anyone tell me? ↩︎

I just checked and it wouldn’t let me go below 1. THEREFOREEE you cannot grant negative health even though it should be easy to add and would be awesome!

1 Like

Maybe the problem is that we are trying to grant something that doesn’t exist. You don’t grant -1 item, you take one away, hence why it stops working if you have 0 of that item. [1]


  1. Or maybe it’s because softlocking would become much easier if they were a thing. Or maybe they’re getting added in the DLD update. OR maybe they have plans to make it a seperate device? ↩︎

1 Like

I don’t get it but good job! :+1:

I’m just trying to say that maybe a negative health granter would make softlocking too easy.

1 Like

Thanks this is the solution to number 2 once I have a solution to all the question I will close this down

1 Like

For 1 and 3, you’re either going to need to use pusedo-health or wait until the negative health granter comes out.

okay thanks for the help

1 Like

For #1, use a lifecycle → triggerloop → counter. You could have the triggerloop also connect to a different trigger that connects to the counter, so when you eat food, the second trigger is deactivated, slowing down the speed at which the counter is decremented.

1 Like

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