Ok, now I'm stuck.

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Wertmanzzz
Lance Corporal
Posts: 21
Joined: Sun Feb 12, 2006 2:09 pm
Location: The Netherlands

Ok, now I'm stuck.

Post by Wertmanzzz »

Hey there folks, I'm almost done with my headbangmod, only there's only 1 thing remaining, that's the damaging of the other player. :?
Here's what I want to do in words:

Code: Select all

killthread local.player:
headtrigger_# triggerable (make sure that it's triggerable)
if local.player exists
{
	wait until headtrigger_# is triggered.
                if local.player.state == "HEADBANG"
	{
		if headtrigger is touching an other human
		hurt the other human
                                wait until the headbang state is over
	}
}
end

(Headtrigger is the trigger attached to the head
Well do you guys have experience with this stuff??
Thanks already,
Wertmanzzz
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Code: Select all

head_bang:

while(1) // put it in a loop so it runs all the time
{

for(local.i = 1;local.i <= $player.size;local.i++) // go through all the players
{
if(level.headbang[$player[local.i].dmteam] != NULL && level.headbang[$player[local.i].dmteam] != NIL) // if players team has a headbanger
{
if(vector_length ( $player[local.i].origin - level.headbang[$player[local.i].dmteam].origin ) < 25) // player must be within 25 units to be damaged
{
if($player[local.i].health  1)
{
$player[local.i] volumedamage 15
}
}
}
}
waitframe
}
end
I did not test this :wink:
Image
Wertmanzzz
Lance Corporal
Posts: 21
Joined: Sun Feb 12, 2006 2:09 pm
Location: The Netherlands

Post by Wertmanzzz »

Srry m8, didnt work :(
Post Reply