StopSound

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

stopSound

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Stops and releases a sound owned by the current client resource.

Syntax

bool stopSound(number sound)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.

Returns

Returns true when the current resource owned and stopped the sound; otherwise returns false.

Examples

Stop a previously created loop:

if forge then
    stopSound(forge)
    forge = nil
end

Notes

  • Available only in client-side resource scripts.
  • A successful call invalidates the handle.
  • Stopping a resource automatically releases every sound it still owns, including sounds created before a later script failed resource startup.