Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Walking plus timmer

Watch Coats
Registered User
Join date: 22 Aug 2006
Posts: 23
07-21-2008 11:06
I want to make a script that will rezz somthing at my feet for x seconds when i touch it and then stop after X amount of time. Below is what i have so far but i think i am going in the wrong direction :-(. Thanks

float gap = 10.0;
integer touched;

default
{
state_entry()
{
touched = TRUE;
llSetTimerEvent(gap);
}
touch_start(integer total_number)
{
if (!touched) {

if (AGENT_WALKING | llGetAgentInfo(llDetectedKey(0)))

{

llSleep(0.2);
llRezObject("Object", llGetPos() + <0,-3,-0.7>, ZERO_VECTOR, ZERO_ROTATION, 02);
}


touched = TRUE;
llSetTimerEvent(0);
llSetTimerEvent(gap);
}
}
timer()
{
touched = FALSE;
}
}
Urrong Urnst
Registered User
Join date: 12 Jul 2008
Posts: 49
07-22-2008 23:35
Will the prim with the script inside be attached on the avatar's body?
Watch Coats
Registered User
Join date: 22 Aug 2006
Posts: 23
07-23-2008 04:43
yes
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-23-2008 19:14
Should the thing that appears at the avatar's feet move along with the walking, or just stop where rezzed? If it can move along with the avatar, could it be part of the scripted attachment itself, and just show/hide (or become visible by llSetLinkPrimitiveParams()), or does it need to be a separate object rezzed in-world?

If it must be separately rezzed, then making it disappear after a fixed amount of time would require that the rezzed object be scripted to either know how long to live, or to listen for a command to llDie issued by the rezzing object. (That's assuming the "fixed amount of time" isn't "about a minute", for which just making it temporary might be good enough.)

Note also that rezzing stuff would require that the wearer have build permission on the parcel, and that the parcel have prims available.

(Oh, just in passing, I suspect you want "&" instead of "|" to test llGetAgentInfo() for AGENT_WALKING.)
_____________________
Archived for Your Protection