Could someone please write me a script?
It's about a coughing sound with a shake when you are near smoke and dust.
Thanks in Advance
[HL2:DM] Cough and Shake
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [HL2:DM] Cough and Shake
When you say smoke and dust, are you referring to map based entities/effects?
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [HL2:DM] Cough and Shake
but also from my plugin the effects when a grenate explodes there is also an overlay.
I show here an SP script which causes these overlay effects.(An example )
I show here an SP script which causes these overlay effects.(An example )
Syntax: Select all
from entities import TakeDamageInfo
from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from players.entity import Player
from weapons.manager import weapon_manager
DAMAGE_TRIGGERS = [
'npc_grenade_frag',
'grenade_ar2',
'rpg_missile',
'npc_tripmine',
]
@EntityPreHook(EntityCondition.is_player, 'on_take_damage')
def _pre_take_damage(stack_data):
victim = make_object(Entity, stack_data[0])
if not victim.is_player():
return
info = make_object(TakeDamageInfo, stack_data[1])
try:
weapon_index = info.weapon
weapon = Entity(weapon_index).classname
except:
return
try:
if weapon in DAMAGE_TRIGGERS:
fragcloud(Player(victim.index))
except AttributeError:
pass
def fragcloud(victim):
entity = make_object(Entity, victim.give_named_item('env_ar2explosion'))
entity.set_key_value_string('material', 'test/SmokeTex_1.vmt')
entity.call_input('Explode')
entity.delay(8, entity.remove)
Who is online
Users browsing this forum: No registered users and 76 guests