sophy7777 Posted June 19, 2020 Share Posted June 19, 2020 Hey all, first of all hope your well! im having a lil bother scripting a toy car. i cant seem to find a script that when attached it plays a idle animation but when walking plays another. im thinking attached is the best way? im not very sure im not a scripted at all. i have tried some car scripts but couldnt find any instructions or easy to use ones so if anyone knows of any simpler ones please link thanks all and stay safe ❤️ included a picture to help explain what im scripting! Link to comment Share on other sites More sharing options...
Xiija Posted June 23, 2020 Share Posted June 23, 2020 (edited) here is a very simplified example, with a few events, of the logic flow? state_entry() { if(llGetAttached() ) { llRequestPermissions(llGetOwner(), PERMISSION_OVERRIDE_ANIMATIONS | PERMISSION_TAKE_CONTROLS ); } } attach( key k ) { if ( k != NULL_KEY ) { llRequestPermissions(llGetOwner(), PERMISSION_OVERRIDE_ANIMATIONS | PERMISSION_TAKE_CONTROLS ); } } run_time_permissions(integer perm) { if( perm & PERMISSION_TAKE_CONTROLS ) { llTakeControls( CONTROL_DOWN|CONTROL_UP|CONTROL_FWD|CONTROL_BACK|CONTROL_LEFT|CONTROL_RIGHT |CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT, TRUE, TRUE); } if ( perm & PERMISSION_OVERRIDE_ANIMATIONS ) { // replace normal anims with your car anims .... i.e. ... car_going_fast, car_idle, car_normal_speed llSetAnimationOverride( "Running", car_going_fast); llSetAnimationOverride( "Standing", car_idle); llSetAnimationOverride( "Walking", car_normal_speed); } } control( key _id, integer _level, integer _edge ) { float speed = 5.0; if( _level & CONTROL_FWD) { if( llGetAgentInfo(llGetOwner() ) & AGENT_ALWAYS_RUN ) { llApplyImpulse(< speed,0,0>,TRUE); } } } Edited June 23, 2020 by Xiija Link to comment Share on other sites More sharing options...
Recommended Posts
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