Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting....need help

Kwaung Titan
Junior Member
Join date: 28 Jun 2003
Posts: 9
07-04-2003 06:10
I try to control object by pressing keybroad.. But till now I cant
do that what I want.. (I doesnt move). I read all help and guild but I cant complete understand it.. Who can guide me,please?

my code like this.. (not full)

llRequestPermissions(owner, PERMISSION_TAKE_CONTROLS);



run_time_permissions(PERMISSION_TAKE_CONTROLS)
{

llTakeControls(CONTROL_LBUTTON, TRUE,1);
//Take control key from owner
llTakeControls(CONTROL_DOWN, TRUE,1);
}

//control event handle
control(key name, integer levels, integer edges)
{
llSay(0, "Entering Control Event.";);
.
.
.
.

}
I think it not work cause it not enter Control Event..Cause I not see object say "Entering Control Event".

This is all I know \(T0T)/
Thank you :D
Madox Kobayashi
Madox Labs R&D
Join date: 28 Jun 2003
Posts: 402
07-04-2003 06:27
I am at work and can't check, but I think instead of this:

run_time_permissions(PERMISSION_TAKE_CONTROLS)
{
...
}

you want:

run_time_permissions(integer perms)
{
if (perms & PERMISSION_TAKE_CONTROLS) {
....
}
}
_____________________
Madox Kobayashi

Kwaung Titan
Junior Member
Join date: 28 Jun 2003
Posts: 9
Ohh Thank you
07-04-2003 15:59
Thank you .. I will try this.:D
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
07-04-2003 17:08
also you should ask to take control of all the keys you want at one time.

CODE

default
{
run_time_permissions(integer perm)
{
if (perm)
{
llTakeControls(CONTROL_FWD | CONTROL_UP | CONTROL_DOWN , TRUE, TRUE);
}
}

attach(key id)
{
if (id != NULL_KEY)
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
else
{
llReleaseControls();
}
}

control((key id, integer level, integer edge)
{
//do all the stuff you want to do here.
}
}
_____________________
i've got nothing. ;)
Kwaung Titan
Junior Member
Join date: 28 Jun 2003
Posts: 9
Ohhh It Workingggg
07-05-2003 05:27
Thank you..for tell me a code.. Now I can control my radio controler car with no talk to it.. Thank you :D