Give it these values:
Key: Model
Value: xmodel/barrel_black1
Give it the following values:
Key: Targetname
Value: Barrel
Now create a Script_orgin
Give it the following Values:
Key: Targetname
Value: Barrel_so
Place the script orgin inside the barrel
Now make a Textures>common>trigger around the barrel
Make it a Trigger_Damage
Give it the following values:
Key: Targetname
Value: Barrel_Trigger
Thats it for the mapping, now onto scripting...
Create a new text document name it (map name).gsc
Put the following in the .gsc file:
Code: Select all
main()
{
barrel();
}
barrel()
{
trig = getent("Barrel_Trigger","targetname");
block = getent ("Barrel","targetname");
so = getent ("Barrel_so","targetname");
boom = loadfx("fx/explosions/mp_bomb.efx");
while (1)
{
trig waittill ("damage", idamage);
if(idamage > 50)
{
playfx(boom, so.origin);
block moveZ (400, 1, 0, 1);
block waittill ("movedone");
wait 0.05;
block moveZ (-400, 1, 1, 0);
block waittill ("movedone");
block movez (8, .05, 0, 0);
block waittill ("movedone");
block movez (-8, .05, 0, 0);
block waittill ("movedone");
}
}
}