Colin Eternal
-
Posts
6 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Posts posted by Colin Eternal
-
-
Sorry, you're right, this should avoid that problem
// Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Rock"; // Name of object in inventoryvector relativePosOffset = <0.0, 0.0, 2.0>; // "Forward" and a little "above" this primvector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 50;float MaxDist = 3.0;string dist;integer active = TRUE;float time = 15.0; //change this for how long to ignore touches default{ state_entry() { dist = llGetSubString((string)MaxDist,0,(llSubStringIndex((string)MaxDist,".")+2)); // llOwnerSay(dist); } touch_start(integer a) { if (active) { key k = llDetectedKey(0); vector pos = llGetPos(); if(llVecDist(pos,llDetectedPos(0))>MaxDist){ llRegionSayTo(k,0,"Sorry, "+llGetDisplayName(k)+" but you must be no more than "+dist+" metres away for this to work"); return; } else{ llRegionSayTo(k,0,"You are within the maximum range"); //do stuff } { active = FALSE; llSetTimerEvent(time); vector myPos = llGetPos(); rotation myRot = llGetRot() vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot rotation rezRot = relativeRot*myRot llRezObject(object, rezPos, rezVel, rezRot, startParam); } } }timer(){ llSetTimerEvent(0); active = TRUE;}}
-
You can either do it the way Rolig described or like this where there is a timer to ignore the touches:
// Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.string object = "Rock"; // Name of object in inventoryvector relativePosOffset = <0.0, 0.0, 2.0>; // "Forward" and a little "above" this primvector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/srotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this priminteger startParam = 50;float MaxDist = 3.0;string dist;integer active = TRUE;float time = 15.0; //change this for how long to ignore touches default{ state_entry() { dist = llGetSubString((string)MaxDist,0,(llSubStringIndex((string)MaxDist,".")+2)); // llOwnerSay(dist); } touch_start(integer a) { if (active) { active = FALSE; llSetTimerEvent(time); key k = llDetectedKey(0); vector pos = llGetPos(); if(llVecDist(pos,llDetectedPos(0))>MaxDist){ llRegionSayTo(k,0,"Sorry, "+llGetDisplayName(k)+" but you must be no more than "+dist+" metres away for this to work"); return; } else{ llRegionSayTo(k,0,"You are within the maximum range"); //do stuff } { vector myPos = llGetPos(); rotation myRot = llGetRot() vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot rotation rezRot = relativeRot*myRot llRezObject(object, rezPos, rezVel, rezRot, startParam); } } }timer(){ llSetTimerEvent(0); active = TRUE;}}
-
First of all, you can't limit where clothes, animations, etc are used. The only thing you could limit would be objects, assuming you have mod rights to them, by using a script that deletes or disables the object if rezzed in a sim other than the one named in the script. Is that what you are looking for?
-
I can create scripts for any purposes, optimised for minimum lag. Prices depend on the complexity of the script, send me a notecard or IM in-world and we can discuss exactly what you want. Any bugs found afterwards will be fixed free of charge. Please note that I am only a scripter, not a builder/sculptor/animator.
How do i make a "Cool down timer"?
in LSL Scripting
Posted
you can edit the time in the part near the top:
it's in seconds so if you want 10 mins change it to:
A version with loading and ready messages:
What do you mean by timer? Like a countdown in chat or something?