GetTriggerScriptStringVariable

Definition

string GetTriggerScriptStringVariable(string triggerName, string variable)

Description

This function gets the value of the String variable defined in the script attached to the triggerName trigger object.

Parameters

triggerName
Specifies the name of the trigger object.

variable
Specifies the name of the String variable defined in the script attached to the triggerName trigger object.

Return Value

Returns the value of the String variable defined in the script attached to the triggerName trigger object.

Example

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

return_value = ""

function Init()
    return_value = GetTriggerScriptStringVariable("trigger1""a")
end

function Update()

end
Assuming that the variable “a” is defined with the value “hello” in the script attached to the trigger object “trigger1”GetTriggerScriptStringVariable function returns the value “hello”.
adminGetTriggerScriptStringVariable