Jump to content

Help with RC script


iggur
 Share

You are about to reply to a thread that has been inactive for 4625 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello i have my RC  script that works fine with my plane, but when my friend tuch it he cants get the option to control the plane with that RC script, maybe someone can look at those lines, i pase some of the lines that i thought my help

 


float speed = 0;

float turn = 0;

float lift = 0;

integer move = FALSE;

integer turning = FALSE;

key avatar;integer on;
default

 

}

 

 

 

);

llOwnerSay("/me Let's Fly! -> (Touch to Activate)");

}

//

touch_start(integer t)

{

avatar = llDetectedKey(0);

string name=llKey2Name(avatar);

if((avatar == llGetOwner()) && (on == TRUE))

{

llSetStatus(STATUS_PHYSICS, FALSE);

llStopSound();

llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);

llReleaseControls();

llSleep(.2);

llPlaySound("2ffa2ee9-14f6-f90a-2bc0-7399984331ce", .5);

on = FALSE;

}

else if((avatar == llGetOwner()) && (on == FALSE))

{

llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);

llRequestPermissions(avatar,PERMISSION_TAKE_CONTROLS);

on = TRUE;

}

}

//

run_time_permissions(integer perms)

{

if(perms & (PERMISSION_TAKE_CONTROLS))

{

llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT | CONTROL_UP | CONTROL_DOWN, TRUE, FALSE);

llSetStatus(STATUS_PHYSICS, TRUE);

llPlaySound("99aa862f-5875-2bec-f13f-d26528f379fa", .5);

llOwnerSay("/me Contact!");

llSleep(8.0);

llOwnerSay("/me Take Off!");

    llLoopSound("99aa862f-5875-2bec-f13f-d26528f379fa", .5);

}

else

{

llStopSound();

llReleaseControls();

llSetStatus(STATUS_PHYSICS,FALSE);

 

Link to comment
Share on other sites

Well, first off you're code has several tests for (avatar == llGetOwner())

So only the owner of the object will be allowed to control it! You could try giving a copy of the build to your friend, then they will become the owner and can use it. Or take out those tests if you want anyone to be able to use it.

Link to comment
Share on other sites

I cant make it's for my friend,because i want the every user can remote it

I tried to do some changes, its no working (dont have enough experience)....can anybody please change it or me..

 

 

 

here's 80 of the code: (20000 characters is max)

 

}

 

 

float speed = 0;

float turn = 0;

float lift = 0;

integer move = FALSE;

integer turning = FALSE;

key avatar;

integer on;

 

default

{

state_entry()

{

llSetVehicleType(VEHICLE_TYPE_AIRPLANE);

llRemoveVehicleFlags(-1);

llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <1, 2, 1> );

llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <0.5,0.5,0.5> );

llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> );

llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 0.2 );

llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.75 );

llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> );

llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.2 );

llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.3 );

llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );

llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0 );

llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 );

llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0.99 );

llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 );

llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 2 );

llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 1 );

llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 2 );

llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5 );

llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 2 );

llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0.7 );

llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.5 );

llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 0.2 );

llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );

llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY

| VEHICLE_FLAG_HOVER_TERRAIN_ONLY

| VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT

| VEHICLE_FLAG_LIMIT_ROLL_ONLY

| VEHICLE_FLAG_HOVER_UP_ONLY

| VEHICLE_FLAG_LIMIT_MOTOR_UP);

llStopSound();

llCollisionSound("", 0.0);

llSetStatus(STATUS_PHYSICS, FALSE);

llOwnerSay("/me Let's Fly! -> (Touch to Activate)");

}

//

touch_start(integer t)

{

avatar = llDetectedKey(0);

string name=llKey2Name(avatar);

if((avatar == llGetOwner()) && (on == TRUE))

{

llSetStatus(STATUS_PHYSICS, FALSE);

llStopSound();

llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);

llReleaseControls();

llSleep(.2);

llPlaySound("2ffa2ee9-14f6-f90a-2bc0-7399984331ce", .5);

on = FALSE;

}

else if((avatar == llGetOwner()) && (on == FALSE))

{

llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);

llRequestPermissions(avatar,PERMISSION_TAKE_CONTROLS);

on = TRUE;

}

}

//

run_time_permissions(integer perms)

{

if(perms & (PERMISSION_TAKE_CONTROLS))



 

Link to comment
Share on other sites

It's very tempting to suggest that you should start learning to write LSL scripts by working on shorter, simpler things first.  As others have pointed out, you need to change owners before doing anything if you want the script to work for your friend without being reset.  Either that or remove the if tests that restrict access to the owner.  There are other things too (though non-fatal). There's no need to use llKey2Name(avatar), for example, when you can already know the name from llDetectedName.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4625 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...