interface
SoundEmitOptionsOptions for Sound.emit — the source entity, recipient slots, and volume.
entity?: EntityRefrecipients?: number[]volume?: number@s2script/sdk/sound
engine-generic sound: emit a named SoundEvent + register custom precache paths.
import { SoundEmitOptions } from "@s2script/sdk/sound";Author-time types ship in the npm package; the engine injects the runtime at plugin load. Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
SoundEmitOptionsOptions for Sound.emit — the source entity, recipient slots, and volume.
entity?: EntityRefrecipients?: number[]volume?: numberPrecacheContextBlock-scoped precache context — valid ONLY during the onPrecache dispatch. Synchronous use
only: a stashed context used after the handler returns (or past an await) is a no-op false
(the engine manifest is gone).
add(path: string): booleanSoundEngine-generic sound entry point — play a named SoundEvent to some or all clients.
import { Sound } from "@s2script/sdk/sound";
// global 2D broadcast to every valid client (worldspawn source):
const guid = Sound.emit("MyPack.Ping");
if (guid === 0) console.log("emit failed (unresolved name / stale source)");emit(name: string, opts?: SoundEmitOptions): numberrecipients array). An all-bot-skipped recipient
set still emits to nobody (a real engine call, may return a nonzero GUID).