Jump to content

prim name toggle script


ZenriaCo
 Share

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

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

Recommended Posts

hello there 

i will have to admit i am not scripter but i am somewhat of a builder. I am currently trying make a script that will toggle the name of a prim between two names E.g. "Prim A" to "Prim B" and back again. I have no idea how to go about this. would anyone be able to help me get this simple script what i found what seems to be able to do part of the job working to be touch toggle?. Thank you for reading :)

 

ThE zAnY zEn

 

default
{
    state_entry()
    {
        llSetObjectName("NEW PRIM NAME");
    }
}

 

Link to comment
Share on other sites

All you need to add is a simple switch.

integer gON;default{    touch_start(integer num)    {        if (gON)        {            llSetObjectName("Prim A");        }        else        {            llSetObjectName("Prim B");        }        gON = !gON;    }}

 Or, more simply ....

 

integer gON;default{    touch_start(integer num)    {        llSetObjectName("Prim " + llList2String(["A","B"],(gON = !gON)));    }}

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3665 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...