
I was violently stopped on a script that is used for a point system that attaches to an avatar and shows thier score on top of their head. It also uses a scoreboard but that's beside the point. When i tested it it worked great and thought I was done but when my friend tried it, it wouldn't attack to him. I looked for info and found that you can't attach items to OTHER avatars, sad panda. So wats a good way to get around this...I posted the scripts I have right now. Thank you.
this is the item that WOULD attach:
[/php]
key person;
string name;
integer score = 0;
default
{
state_entry()
{
llListen(0, "","Reset", ""
;llVolumeDetect(TRUE);
}
collision_start(integer totalNumber)
{
integer i = 0;
person = llDetectedKey(i);
name = llDetectedName(i);
llRequestPermissions((key)person, PERMISSION_ATTACH);
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_ATTACH)
{
llSay(-5, "reset"
;llAttachToAvatar(ATTACH_NOSE);
state count;
}
}
on_rez(integer start)
{
llResetScript();
}
}
state count
{
state_entry()
{
llListen(-4, "","",""
;llSetText((string)score,<0,0,1>,1);
}
listen(integer channel, string s, key k, string msg)
{
if(msg == "plus"

{
llSay(0, "Got point msg"
;++score;
llSetText((string)score,<0,0,1>,1);
}
else if(msg == "die"

{
llSay(0, "Got die msg"
;llSay(-5, name + "," + (string)score);
llDetachFromAvatar();
llDie();
}
}
}
[/php]
and this is too welcome them and reset stuff:
[/php]
key person = NULL_KEY;
string name = "";
integer counter = 0;
integer i = 0;
default
{
state_entry()
{
llListen(0, "","Reset", ""
;llVolumeDetect(TRUE);
}
collision_end(integer totalNumber)
{
if( person == NULL_KEY)
{
person = llDetectedKey(i);
name = llDetectedName(i);
llSay(0, "Welcome to House 2 " + name);
}
else if(person == llDetectedKey(i))
{
llSay(-4, "die"
;llSay(0, "Hope you enjoyed your visit " + name);
person = NULL_KEY;
llRezObject("counter", llGetPos(), <0,0,0>, <0,0,0,1>, 0);
}
}
}
[/php]
I hope that one day my children will be able to attach things freely to your or other peoples children.
One day.