Author Topic: Check if player is under brick?  (Read 671 times)

I am making a winter survival campaign, and I need it so that when the player is not under a brick, the players loses some "body heat". When the "body heat" runs out, the player begins to lose health until they find shelter (in other words, when they get under a brick) and body heat regenerates.
Unfortunately I am a bad scripter and have no idea how it would be done.

Basically like gmod survival but instead of lose health when no shelter while sleeping, lose health while outside.
« Last Edit: April 05, 2010, 04:33:56 PM by Yogurt Man »

You might want to take a look at zonebricks.

You might want to take a look at zonebricks.
No, I mean any brick placed. Its an rp, were people can join, that can be abused.
The goal is to build a house.

You could raycast upwards with a mask for bricks.

You could raycast upwards with a mask for bricks.
Hurr, dunno what that means.

Brick



Player
==================
Brick
^
^
^
Player

Error! Brick above player!
==================




Player
==================

^
^
^
Player

Yay! No brick is above the player.

Hurr, dunno what that means.
Don't be an starfish, we're helping you.
Code: [Select]
%start = %obj.getPosition();
%end = vectorAdd(%start, "0 0 500");
%typemasks = $Typemasks::FXbrickObjectType; //Add "Always" between "brick" and "object if you want non-raycasting bricks to be included
%ray = containerRaycast(%start, %end, %typemasks);
if(isObject(%brick = firstWord(%ray)))
{
   echo("Brick detected!");
}

The goal is to build a house.
This would work up until someone figures out all you have to do is put a brick over your head.

This would work up until someone figures out all you have to do is put a brick over your head.
Make certain bricks called RPTent, RPBaseplate, and such, and do a raycast to see if you are touching them as well?

Make certain bricks called RPTent, RPBaseplate, and such, and do a raycast to see if you are touching them as well?
People would place one expecting to be magically safe by standing on that section of ground, not building anything.

Other than that it'll lead to constructions with a plate, a single 1x1x5 brick and another on top.

People will do the simplest thing to keep safe.

Yea, but a house shouldn't generate heat in the first place. A campfire should generate heat.