LlGetScriptState

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: integer llGetScriptState( string script );
参数:string script – 这个脚本的目录中有一个脚本
返回值:返回一个布尔值(一个整数),如果脚本正在运行,该值为TRUE。
注意事项
如果脚本从基本物体的库存中丢失,或者它不是一个脚本,那么DEBUG_CHANNEL将显示错误。
示例
示例1
default
{
    touch_start(integer num_detected)
    {
        integer numberOfScripts = llGetInventoryNumber(INVENTORY_SCRIPT);
 
        integer index;
        do
        {
            string scriptName = llGetInventoryName(INVENTORY_SCRIPT, index);
            integer scriptState = llGetScriptState(scriptName);
 
        //  默认值
            string output = "FALSE";
        //  另外
            if (scriptState) output = "TRUE";
 
            // PUBLIC_CHANNEL的整数值为0
            llSay(PUBLIC_CHANNEL,
                "Script named '" + scriptName + "' has current script state '" + output + "'.");
        }
        while (++index < numberOfScripts);
    }
}
相关函数
llSetScriptState

llResetOtherScript

相关事件