2 error messages that I'm getting is that # is an illegal character and the other problem is with SR1 SR2 etc...
Any help would definitely be appreciated. Thank you!
Here is the script:
Code: Select all
integer spin#=0;
integer finalspin=0;
integer SpinResult=0;
integer SpinResult1=0;
integer SpinResult2=0;
integer SpinResult3=0;
PrizeCheck(integer SR1, integer SR2, integer SR3)
{
;
if (SR1<SR2 && SR2<SR3)
{
llWhisper (0, llDetectedName(0) + ", you win a PRIZE");
llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_OBJECT,(integer)llFrand(llGetInventoryNumber(INVENTORY_OBJECT))));
}
else
llWhisper (0, llDetectedName(0) + ", sorry, you do not win a prize. Try again?");
// llResetScript(); // next contestant
}
spinCylinder(integer linkNumber) {
list baseRot = llGetLinkPrimitiveParams(linkNumber,[PRIM_ROTATION]);
integer numberMoves = (integer)(llFrand(300.0)+300); // changed from llFrand(300.0)
float angle = 0;
float changeAngle=PI/10.0*((float)numberMoves)/300.0;
//check which spin#
spin#++;
llWhisper (0, "This is Spin number " +(string) spin#) ;
if (spin#==3)
{
finalspin=1; //flag finalspin for prize checking
llWhisper (0, "That was your final spin. " ) ;
}
llPlaySound("Game Wheel Spin",1.0);
while(numberMoves > 0)
{
angle += changeAngle;
llSetLinkPrimitiveParamsFast(linkNumber,
[PRIM_ROTATION,
llEuler2Rot(<0.0,0.0,angle>)*llList2Rot(baseRot,0)/llGetRootRotation()/llGetRootRotation()]);
llSleep(0.003); // Sleep controls spin duraction, was 0.03
changeAngle *= 0.98;//deceleration of wheel only
numberMoves -= 1;
}
baseRot = llGetLinkPrimitiveParams(linkNumber,[PRIM_ROTATION]);
vector finalRot = llRot2Euler(llList2Rot(baseRot,0)/llGetRootRotation());
// check for this spin result
if( (integer)(finalRot.z*RAD_TO_DEG/15.0+13)==1 )
{
llWhisper(0,"And the number is " + (string)((integer)(finalRot.z*RAD_TO_DEG/15.0+13)));
llPlaySound("smallbell",1.0);
SpinResult=1; //use SpinResult for prizes or game
}
else
{
llWhisper(0,"And the number is " + (string)((integer)(14-finalRot.z*RAD_TO_DEG/15.0)));
llPlaySound("smallbell",1.0);
SpinResult=(integer)(14-finalRot.z*RAD_TO_DEG/15.0); //use SpinResult for prizes or game
}
//llWhisper( 0, "check on SpinResult = " + (string)(SpinResult) ); // test only
if (spin#==1) {
SpinResult1=SpinResult;
}
if (spin#==2) {
SpinResult2=SpinResult;
}
if (spin#==3) {
SpinResult3=SpinResult;
PrizeCheck(SpinResult1,SpinResult2,SpinResult3); // subroutine build
spin#=0; //reset for next contestant
}
//llOwnerSay ("TEST Spin Results "+(string)SpinResult1 +" " +(string)SpinResult2 +" " +(string)SpinResult3 ) ;
}
//----------------------------------------------------------
default
{
touch_start(integer number) {
integer lupe = llGetNumberOfPrims()+1;
while(--lupe > 1) {
if(llGetLinkName(lupe)=="wheel"){
llWhisper(0, "\nWheee! " + llDetectedName(0) + " is spinning the wheel! Wait for wheel to completely stop.");
if (spin#==3){
spin#==0;
}
spinCylinder(lupe);
}
}
}
}

https://marketplace.secondlife.com/p/St ... ms/6324032
.