Is there a way to check if a player is under a certain health amount?

I want to make it so that some sort of mechanic finds a random player under a certain health amount so that it can teleport them to a place they can heal, but only one person per game. Is there a way to do this?

6 Likes

You might be able to link a player’s health to a property, but I don’t know.

2 Likes

There’s not really a way to link health to anything unfortunately. The closest thing to that is an item and an inventory item manager but you can’t really detect damage, only knockouts.

5 Likes

What is clay-institute

3 Likes

A hard problem that if solved, could open up huge areas of study and lots more games.

4 Likes

There are ways to do this if you have specific environmental methods of removing a player’s health, but weapons can’t be used for this (see NavyCat’s answer). If you want to use a device like the Zone to deal damage to the player, you can use a laser beam linked to a trigger (unlike weapons, the laser beam allows you to keep track of damage done) to update a property. Here’s an example:

image
image

When triggered, the laser beam reduces the player’s health by 10 and activates the trigger. The trigger runs a block-script that reduces the property representing the player’s health by 10, and (if you want) a message can be sent from the trigger that updates the display. Because the player automatically respawns when at 0 health, the property is for reference purposes only (you don’t need to use it to actually respawn the player, just to reset the health property upon reaching 0 health), but you can use it as a reference point in other devices/blocks to accomplish the regenerative-teleport mentioned in your post. Unfortunately, I’m guessing that your game is going to involve weapons, so this is only a partial solution… hopefully there’s some other solution that we haven’t thought of yet :]

10 Likes

Bumping because…wait, is this still resolved or not due to the post above me?

2 Likes

It is not, because it is only possible under certain conditions, like @Zypheir stated. Also, clay-institute means that if it were to be solved, then, “It would open a whole new world of games and ideas.” - @ClicClac

4 Likes

Yea, i know.

3 Likes

I made a working keyboard and chat system; would that be clay-institute or game mechanics?


@ClicClac
@Kyro

6 Likes

I’m not quite sure, try asking @ClicClac or @kyro. As far as i know, @Anythinger and @bushenberg made a keyboard too

1 Like

itd probably be hard to implement in game but a lot of people did want a chat feature so it could be clay-institute but it definitely is game-mechanics

1 Like

I won’t post the full guide, at least not soon. It took me all day. At first, it’ll just say the working concept.

4 Likes

yeah i think it would be clay institute

1 Like

Maybe both. It does work! I’m adding the backspace right now.

5 Likes

yeah

1 Like

nice!

1 Like

Backspace is very hard to do.

1 Like

No, here’s all the code it took for my setup.
image
That’s literally most of backspace right there.

2 Likes

That’s a clear everything system…

1 Like