This is in CSGO, Hammer.
Hey so ill get right to it >
I have a knife and a bow parented to that knife.
The player that picks the knife activates the game_ui, every time he presses right click the bow shoots a bullet.
My problem is that if the player dies in warmup and respwans, if he presses right click the server crashes.
I'm trying to make a script to deactivate the game ui whenever the player dies, but it doesn't work for some reason. this is what i got:
PHP Code:
function IsDead() {
if(activator.GetHealth()<1) {
EntFire( "!self", "Deactivate", "", 0 );
}
}
And im getting this error in console
AN ERROR HAS OCCURED [the index 'GetHealth' does not exist]
CALLSTACK
*FUNCTION [IsDead()] fixui.nut line [4]
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[this] TABLE
[this] TABLE
Any help? thanks in advance!