integer communicationChannel = 7779;vector direction;default{ state_entry() { llOwnerSay("running"); llSetRemoteScriptAccessPin(69); llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y, FALSE); llSetStatus(STATUS_PHYSICS, TRUE); llListen(communicationChannel, "", NULL_KEY, "shoot"); llSensorRepeat("",NULL_KEY,AGENT,1.5,2*PI,.5); //check whether the ball is close } sensor(integer total_number) { vector pos = llDetectedPos(0); vector unit = <1,0,0>; vector offset; offset=(unit * llDetectedRot(0)); //rotate vector unit pos+=offset; direction=offset*6; //set direction of the kick in the bottom llMoveToTarget(pos,.1); } listen(integer channel, string name, key id, string message) { llOwnerSay("now shooting"); llApplyImpulse(direction,TRUE); //kick the ball }}
If if I'm not in posession (futher away than 1,5 meters), I try to kick it, the ball moves, but goes back to it's original place, it shouldn't do that as I'm far away, so the event sensor doesn't get triggered. What's the problem with this scipt?