Liberty Unleashed

Scripting => Script Help => Topic started by: Bio on May 01, 2011, 09:43:10 pm

Title: health damage indicator
Post by: Bio on May 01, 2011, 09:43:10 pm
How to start for writing a red flash when taking health damage? And red strobe flashing when 5hp or less.
Title: Re: health damage indicator
Post by: Orpheus on May 02, 2011, 10:44:58 am
I hope you mean Pulsing/pulsating and not stobe :P as a Strobe is a constant flashing, which would make most people rage :P
But anyhow! I was looking into this, and how it can be achieved, as I intend a similar thing for my own server, My current recommendation would be to use the GUI features.

For instance, for the on hit have a timer run to make it show a semi transparent rad image over the entire screen.

Code: [Select]
//create the image at the top of the script
g_GUIRedHit <- GUISprite( "GUIRedHit .png", VectorScreen(0,0) ); // Make sure this Image is plenty big enough to cover the screen.
Code: [Select]
function onPlayerHealthChange (oldhp, newhp)
{
    //Then set a timer to remove it
    g_GUIRedHit.Visible = true
    NewTimer( "RemoveGuiHit", 500, 1);
}

Code: [Select]
function RemoveGuiHit()
{
     g_GUIRedHit.Visible = false
}

Or something Like this. I have yet to write mine as I'm working on re-Writing my whole scripts.
Hope this helps
Regards Orpheus