GetAmbientSoundScriptStringVariable

Definition

string GetAmbientSoundScriptStringVariable(string ambientSoundName, string variable)

Description

This function gets the value of the String variable defined in the script attached to the ambientSoundName ambient sound object.

Parameters

ambientSoundName
Specifies the name of the ambient sound object.

variable
Specifies the name of the String variable defined in the script attached to the ambientSoundName ambient sound.

Return Value

Returns the value of the String variable defined in the script attached to the ambientSoundName  ambient sound object.

Example

--script name is GetAmbientSoundScriptStringVariable.lua attached a to game object such as water

return_value = ""

function Init()
    return_value = GetAmbientSoundScriptStringVariable("sound1""a")
end

function Update()

end
Assuming that the variable “a” is defined with the value “hello” in the script attached to the ambient sound object “sound1”GetAmbientSoundScriptStringVariable function returns the value “hello”.
adminGetAmbientSoundScriptStringVariable