-
Notifications
You must be signed in to change notification settings - Fork 12
Sounds
Playing sounds only audible to a specific player can be done using:
Player.PlayLocalSound("sounds/weapons/taser/taser_hit.vsnd");Sound files can be found using Source2Viewer, and can be used freely without preloading!
To emit sound from an entity, which will be audible to anyone in the vicinity, you can use the extension:
Player.EmitSound("Weapon_M4A1.Silenced");Currently, this can only play sound events, which can be tricky to find. Search for vsndevts_c files in Source2Viewer. Inside, you'll find sound event strings that can be passed to this function. For example, "Weapon_M4A1.Silenced" was found in soundevents/game_sounds_weapons.vsndevts_c.
Although the extension method accepts parameters like volume, pitch, and others, these are experimental and untested.
Custom sounds are unfortunately not supported yet. If you're interested in helping implement this, a good place to start could be the discussion here.
- Getting Started
- Setup Guide
- Your First Hero
- Event Handlers
- Damage
- Particles
- Warcraft Effects
- Props and Velocity
- Collisions and Triggers
- Ray tracing
- Advanced Geometry
- Sounds
- Custom Player Models
- Localization