SetMainCharacterScriptStringVariable

Definition

SetMainCharacterScriptStringVariable(string variable, string value)

Description

This function sets the value of the String variable defined in the script attached to the main character object.

Parameters

variable
Specifies the name of the String variable defined in the script attached to the main character.

value
Specifies the value of the String variable to be set.

Example

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

function Init()
    SetMainCharacterScriptStringVariable("a""hello")
end

function Update()

end
Assuming that the variable “a” is defined in the script attached to the main character object, SetMainCharacterScriptStringVariable function sets the value of “a” to “hello”.
adminSetMainCharacterScriptStringVariable