Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

at a certain velmag...

Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
10-26-2007 19:37
Lol i'm totally blanking out, but I have a question. How would I be able to make this script work? I want it to simply just go off when the avatar it's attached to goes at the specified velocity.
From: someone

integer velmax = 10
default
{
state_entry()
{
while (TRUE)
{
if(llVecMag(llGetVel()) > velmax)
{
llMoveToTarget(llGetPos(),10);
llOwnerSay("STOP CHEATING! FROZEN FOR 10 SECONDS.";);
llSetTimerEvent(10);
}
}
}
timer()
{
llStopMoveToTarget();
llResetScript();
}
}
_____________________
From: someone

Don't worry, Aniam is here!
- Noob
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
something more like... ?
10-27-2007 03:40
CODE

integer vgIntTimeout;
vector vgVecPosition;
integer vgIntMaxVelocity = 10;

default{
state_entry(){
llSetTimerEvent( 5.0 );
}

timer(){
if(llVecMag(llGetVel()) > vgIntMaxVelocity){
vgVecPosition = llGetPos();
llOwnerSay( "Speed Violation: Frozen for 10 seconds" );
llSetTimerEvent( 1.0 );
state vsCheat;
}
}
}

state vsCheat{
state_entry(){
vgIntTimeout = 10;
}

timer{
if (vgIntTimeout){
llMoveToTarget(vgVecPosition ,1);
}else{
state default;
}
--vgIntTimeout;
}
}


basically you need to store llGetPos, or it just moves them to where they are at the moment, and keep sending them to that spot repeatedly for 10 seconds....
polling need not be so fast, I wouldn't go lower than 2sec...
using timer to poll may help prevent lag jumping from affecting the speed calc since timer if subject to dilation...and possibly avoid catching teleporters (assuming there any in your game area)

and busy loops are bad juju
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -