self:is_playing
Client
Checks whether the audio-2d instance is currently playing
Syntax
local result = self:is_playing()Parameters
| No parameters are accepted by this function |
|---|
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true if audio is currently playing, false otherwise |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
if not entity:is_playing() then
entity:play()
end