Jump to content

Detaching a HUD


KennyChidorie
 Share

You are about to reply to a thread that has been inactive for 1620 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi, I have a question - how to make a button, when clicked, which disconnects the hud?

Hud's work system is not simple:

When a user wears the hud, at the same time he has a rigged mesh package in his/her hand + screen hud with button "close" and "unpack" (child prims).

Standard scripts don't work.

TroubleScript trying to detach from agent but PERMISSION_ATTACH permission not set!

 

Link to comment
Share on other sites

"Standard scripts" work just fine.

In the touch_start event, when the script detects that the "detach" button has been clicked (how ever you check that), you just call llRequestPermissions(PERMISSION_ATTACH) and then, in the run_time_permissions event, you call llDetachFromAvatar.

touch_start(integer n)
{
    if (button == detach_button)
    {
        llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
    }
}

run_time_permissions(integer perm)
{
    if (perm)
    {
        llDetachFromAvatar();
    }
}

 

Link to comment
Share on other sites

6 hours ago, Wulfie Reanimator said:

"Standard scripts" work just fine.

In the touch_start event, when the script detects that the "detach" button has been clicked (how ever you check that), you just call llRequestPermissions(PERMISSION_ATTACH) and then, in the run_time_permissions event, you call llDetachFromAvatar.


touch_start(integer n)
{
    if (button == detach_button)
    {
        llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
    }
}

run_time_permissions(integer perm)
{
    if (perm)
    {
        llDetachFromAvatar();
    }
}

 

syntax error

  • Sad 1
Link to comment
Share on other sites

Do you get a line number for where the syntax error occurs? On first glance I can't see anything in Wulfie's code that would throw an error. You might need to paste the two event blocks here for us to look through, assuming the syntax error line number points into one of them.

Edited by Profaitchikenz Haiku
Link to comment
Share on other sites

19 minutes ago, Profaitchikenz Haiku said:

Do you get a line number for where the syntax error occurs? On first glance I can't see anything in Wulfie's code that would throw an error. You might need to paste the two event blocks here for us to look through, assuming the syntax error line number points into one of them.

0,0

Link to comment
Share on other sites

5 minutes ago, Wulfie Reanimator said:

Of course, because it isn't a complete script. You need to use it as an example and implement it into your own script, which you didn't include here.

i can't share that script, because i've got it from mp. But yours didn't help me.

Edited by KennyChidorie
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1620 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...