宠物自动跟随主人移动脚本


Second Life中文指南 http://www.secondlifecn.com/ 第二生命 第二人生_Second Life_ChinaQ_HiPiHi玩家基地 查看完全版 查看精简版
 提醒您:如果本页图片或Flash动画无法正常显示,请点击这里访问原帖。
宠物自动跟随主人移动脚本 作者:Tony 时间:2007-1-17 17:32:13 1
////////////////////////////////////////////////////////////////
// Open Basic Follower/Facing Script, by Logan Bauer. //
////////////////////////////////////////////////////////////////
// OFFSET is the position of your pet in relation to it's owner's position.
// For example, in the default setting below, "vector offset =<-1,0,1>;"
// I.E. (x,y,z), the -1 puts it 1m back behind owner, the 0 means don't have
// it stay left or right, and 1 means have it stay 1m above it's owner.  
// So, if you wanted the script to make it follow directly in front of you,
// and to the left, then you would change it to "vector offset =<1,1,0>;"

vector offset =<-1,0,1>;
startup()
{
        vector pos = llGetPos();
        llSetStatus(STATUS_ROTATE_Z,TRUE);
        llSetStatus(STATUS_PHYSICS, TRUE);
        key id = llGetOwner();
        llSensorRemove();
        llSensorRepeat("",llGetOwner(),AGENT,200,2*PI,.5);
}
default
{
        state_entry()
    {
        startup();
      
    }
    on_rez(integer start_param)
    {
        startup();
    }
    sensor(integer total_number)
    {
        vector pos = llDetectedPos(0);
        llMoveToTarget(pos+offset*llDetectedRot(0),.3);     
        llLookAt(pos, .1 , 1);
    }
}
所属版面:制造&脚本 本主题第1页
共有回复: 0 共有页数: 1 显示主题数:50     说买网 免费购物 U盘生产厂家