Jump to content

Physiker

Resident
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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?
  2. Hi I want to make a script to kick a ball, or shoot on target in soccer. I know it's simple, I tried it but it doesn't work. It seems to apply the impulse, but after that the ball suddenly returns to it's original position. I used the function llApplyImpulse(<5,0,0>,TRUE); Can you help me what's wrong, or post a working script? Thank you.
×
×
  • Create New...