Jump to content

RunsInTheLight

Resident
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. thanks darkie tried the revised script and it works ok .... what i was after it doing witht he timer tho was slightly different..... game length was going to be 30 secs long . and the max number of hits the target could take would be 10.. if someone only managed say 5 hits in that time then 5 would be the total score reflected in the score shouted. but cheers for the timer ill have a play with it ) llShout(-5870,"Your Score: "+"\n"+"yellow: "+(string)yellow+"\n"+"For a Total of "+(string)points+" Points");//say the scored points" Points");//say the scored points
  2. Hi all i have 5 objects all reporting on a different channel to an object rezzer each object is shootable, and can take a max number of hits before reporting its score to the rezzer that then speaks the reported text what i would like to do is to add a timer for 20secs shooting time that reports the amount of hits during that time if the max number of hits hasnt been reached. integer maxNumberOfHits = 10;//the maximum number of hits during gameplay the Target can take until the game will end // integer x = 0;//this is a 'toggle' that switches between TRUE (1) and FALSE (0) and is used to tell other parts of the script that the game has started and a specific function was triggered integer points = 0;//total amount of points earned during gameply integer yellow = 0;//amount of bullseyes hit during gameplay integer numberOfHits = 0;//total amount of times the target was hit during gameplay /////////////////////////////// integer main;//this is the name (integer) that represents the link number for the yellow (Target) say(string text)//just a cleaner looking way of calling 'llSay()' { llSay(0,text); } endGame() { llShout(-5870,"Your Score: "+"\n"+"yellow: "+(string)yellow+"\n"+"For a Total of "+(string)points+" Points");//say the scored points" Points");//say the scored points llSleep(1.0);//sleep for just a second in case other scripted events need to catch } reset()//reset common values. This function is called within the script to reset common values back to default { points = 0;//reset the amount of points scored yellow = 0;//reset how many bullseyes were hit during gameplay numberOfHits = 0;//reset the amount of overall times the Target was hit during gameplay } default { on_rez(integer p){ llResetScript(); } state_entry() { } collision(integer num_detected)//detect information about which part of the Target was hit during gameplay and then update values { integer hit = llDetectedLinkNumber(0);//the linked object number that was hit in the link set is labelled 'hit' if(hit == main)//if the link number that was hit matches the link number for the bullseye prim, then proceed.. { yellow += 1;//add a point to the amount of yellowtarget hit during gameplay points += 1;//add 10 points to the 'total points earned' during gameplay } numberOfHits += 1;//add a point to the amount of hits the Target has taken during gameplay if(numberOfHits >= 10)//if the Target has taken 20 hits during gameplay, then proceed to do the function 'endGame()' { endGame(); llSleep(5); llDie(); } } } any help would be greatly appreciated
  3. umm i'm new to scripting so doesnt surprise me there may be some oddities if i take away the else if (Toggle == TRUE) { Toggle= FALSE; llResetScript(); } } i can get it to start with touch but as soon as i put it back in i still get syntax error at the else if stage
  4. below is a script that's designed to move an object in a 5 meter square am trying to get it to start and stop on touch as soon as i hit save i get the syntax error message at line 27 integer Toggle = FALSE; default { touch_start(integer num_detected) { if (Toggle == FALSE) { Toggle= TRUE; llSetTimerEvent(5); } } timer() { llSleep(3.0); llSetPos(llGetPos()+<0,-5,0>); llSleep(3.0); llSetPos(llGetPos()+<5,0,0>); llSleep(3.0); llSetPos(llGetPos()+<0,5,0>); llSleep(3.0); llSetPos(llGetPos()+<-5,0,0>); } } else if (Toggle == TRUE) { Toggle= FALSE; llResetScript(); } } any help would be greatly appreciated
×
×
  • Create New...