The hitEntity's health not updating.

Started by D4rkR420R, Dec 27, 2018, 07:14 PM

Previous topic - Next topic

D4rkR420R

function Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print(  "Target's health: "+ damaged_player.Health +"" );

Why is it that the player's, getting damaged, health is not updating while I'm shooting at him? Bear in mind that ::pInfo.Instance is basically the instance of the user.

D4rkR420R

Quote from: KuRuMi^ on Dec 27, 2018, 07:14 PMfunction Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print(  "Target's health: "+ damaged_player.Health +"" );

Why is it that the player's, getting damaged, health is not updating while I'm shooting at him? Bear in mind that ::pInfo.Instance is basically the instance of the user.

Okay, for some reason, it's giving the right information to the player getting shot instead of the shooter. Strange. 0.o

D4rkR420R

In conclusion, PlayerShoot seems like a global callback, yet stating the if statements whether the shooter or hitEntity is the user's instance, the code based from its statement will run to that player's game.