Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector COLOR_WHITE = <1.0, 1.0, 1.0>;
- float OPAQUE = 1.0;
- string collectname;
- list convertname; //list to keep track of all the players
- list leaderboard;
- list displayer;
- string convertname2;
- integer nchan;
- integer nhandle;
- key touchid;
- integer GetCh(key id) // make a unieq channel from the key inputted
- {
- return ((integer)("0x"+llGetSubString((string)id,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
- }
- key Region() // get the region uuid
- {
- vector z = llGetRegionCorner();
- return (key)((string)(z.x/256 + 100*z.y));
- }
- default
- {
- state_entry()
- {
- llSay(0, "Script running");
- llSetText("ScoreBoard", COLOR_WHITE, OPAQUE);
- nchan = GetCh(Region()) - 35; //unique channel
- nhandle = llListen(nchan,"","","");
- }
- listen(integer channel, string what, key id, string msg)
- {
- if(channel == nchan)
- {
- //key avi = llGetOwnerKey(id);
- //key avi = llRequestUsername(llGetOwnerKey(id));
- // string usavi = llGetUsername(avi);
- collectname = (string)msg;
- //displayer = (list)collectname;
- //llSay(0,(string)displayer);
- list displayer = llParseString2List(collectname,["_"],[""]); // change seperator to whatever you used as seperator
- key owner = llList2String(displayer,0);
- string avi = llGetUsername(llGetOwnerKey(owner));
- llSay(0,"the Username ID is: " +(string)avi);
- string username = llList2String(displayer,1);
- integer totalpoints = (integer)llList2String(displayer,2);
- //convertname2 = (string)convertname;
- //string id = llList2String(displayer,0);
- // string username = llList2String(displayer,0);
- // string totalpoints = llList2String(displayer,2);
- //displayer = ["Username: "+(string)username] +[" "]+["Total Score: "+(string)totalpoints];
- integer idx = llListFindList(displayer, ["Username: "+avi]);
- //displayer = [];
- //displayer += displayer;
- llSetText("Scoreboard"+"\n"+ (string)displayer + "\n",COLOR_WHITE, OPAQUE);
- //llSetText("Scoreboard"+"\n"+ "Username: "+(string)b +" "+"Total Score: "+(string)c,COLOR_WHITE, OPAQUE);
- if(idx != -1)
- {
- llSay(0,"Replace old user");
- displayer = llListReplaceList(displayer,["Username: "+(string)username] +[" "]+["Total Score: "+(string)totalpoints] ,idx,idx+3);
- }
- else
- {
- llSay(0,"New user");
- displayer += ["\n"]+["Username: "+(string)username] +[" "]+["Total Score: "+(string)totalpoints] ;
- }
- }
- //Click on the scoreboard to add name to scoreboard
- //listen for menu correct answer
- // +1 point for every correct
- }
- touch_start(integer num_detected)
- {
- //touchid = llDetectedKey(0);
- //displayer += convertname2;
- //integer idx = llListFindList(displayer, [touchid]);
- //displayer = llList2List(convertname, 0,2);
- //string stringdisplayer = llDumpList2String(displayer, "_");
- //integer username = llListFindList(displayer, [1]);
- //integer score = llListFindList(displayer, [2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement