Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

takecontrols on sit movementjj

Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
10-27-2007 08:12
Why isn't this movement script working? Whenever I sit on the ball that i put it in, it just doesn't move.
From: someone

integer desired_controls;

default
{
on_rez(integer sp)
{
llResetScript();
}

state_entry()
{
llSitTarget(<0,0,1>,ZERO_ROTATION);
}

changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() == llGetOwner())
{
llRequestPermissions (llGetOwner(),PERMISSION_TAKE_CONTROLS);
}
}
}

run_time_permissions(integer perms)
{
desired_controls =
CONTROL_FWD |
CONTROL_BACK |
CONTROL_LEFT |
CONTROL_RIGHT |
CONTROL_ROT_LEFT |
CONTROL_ROT_RIGHT |
CONTROL_UP |
CONTROL_DOWN;
if (perms & PERMISSION_TAKE_CONTROLS)
{
llTakeControls(desired_controls, TRUE, TRUE);
}


}
control(key id, integer down, integer new)
{
integer pressed = down & new;
integer held = down & ~new;
integer released = ~down & new;

if (pressed & CONTROL_UP)
llSetPos(llGetPos()+<0,0,3>;);
if (pressed & CONTROL_DOWN)
llSetPos(llGetPos()+<0,0,-3>;);
if (pressed & CONTROL_FWD)
llSetPos(llGetPos() + <3,0,0> * llGetRootRotation());
if (pressed & CONTROL_BACK)
llSetPos(llGetPos() + <-3,0,0> * llGetRootRotation());
if (pressed & CONTROL_ROT_LEFT)
llSetRot(llGetRot()+<-3,0,0,1>*llGetRootRotation());
if (pressed & CONTROL_ROT_RIGHT)
llSetRot(llGetRot()+<3,0,0,1>*llGetRootRotation());
if (pressed & CONTROL_LEFT)
llSetPos(llGetPos()+<0,-3,0>*llGetRootRotation());
if (pressed & CONTROL_RIGHT)
llSetPos(llGetPos()+<0,3,0>*llGetRootRotation());

}
}
_____________________
From: someone

Don't worry, Aniam is here!
- Noob
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
10-27-2007 17:44
Didnt look at it too deep, but I changed llTakeControls(desired_controls, TRUE, TRUE); to llTakeControls(desired_controls, TRUE, FALSE);