Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Give Prop Damage?
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#4
RE: Give Prop Damage?

Interesting idea, I hope it works out!

As it happens, I have a solution for ya, because I did something similar. Hint: use LocalVarInts. Every time the axe collides with the door, check for the LocalVarInt and set the health to a certain level, and at the same time, add 1 to the LocalVarInt. That way, every time the function is called, a different output will be made. For example:

void hurtdoor(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("hit") == 0)
{
SetPropHealth(80.0f);
AddLocalVarInt("hit", 1);
}
if(GetLocalVarInt("hit") == 1)
{
SetPropHealth(60.0f);
AddLocalVarInt("hit", 1);
}

...and so on. Hope that helps!

[Image: signature-2.png]
(This post was last modified: 01-21-2012, 05:56 PM by Streetboat.)
01-21-2012, 05:53 PM
Find


Messages In This Thread
Give Prop Damage? - by Shadowfied - 01-21-2012, 05:33 PM
RE: Give Prop Damage? - by flamez3 - 01-21-2012, 05:40 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 05:42 PM
RE: Give Prop Damage? - by Streetboat - 01-21-2012, 05:53 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 06:04 PM
RE: Give Prop Damage? - by Your Computer - 01-21-2012, 06:17 PM
RE: Give Prop Damage? - by Your Computer - 01-21-2012, 05:59 PM
RE: Give Prop Damage? - by Streetboat - 01-21-2012, 07:11 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 07:15 PM



Users browsing this thread: 1 Guest(s)