Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer x; // the for loop counter. gets the link number of the prim in the linkset
- integer mesh; // a variable to store the link in the linkset
- integer mesh2; // a variable to store the link in the linkset
- integer switch; // a variable to store the link in the linkset
- integer allsides; // a variable to store the link in the linkset
- integer detach; // a variable to store the link in the linkset
- string primname; // the name of the prim in the linkset
- default
- {
- on_rez(integer start_param)
- {
- llResetScript();
- }
- state_entry()
- {
- integer total = llGetNumberOfPrims(); // gets the total number of prims in the linkset.
- for(x = 0; x < total; ++x) // start at link 0 do the below process. Check the next link of the linkset and de the below process until all prims in the linkset are checked and processed.
- {
- primname = llToLower(llGetLinkName(x)); // get the name of the link in the linkset
- if(primname == "mesh")
- {
- mesh = x; // if the name of the current prim being dealt with is called "mesh" set the mesh variable to the counter/link number.
- }
- else if(primname == "mesh2")
- {
- mesh2 = x; // or if the name of the current prim being dealt with is called "mesh2" set the mesh2 variable to the counter/link number.
- }
- else if (primname == "switch")
- {
- switch = x; // or if the name of the current prim being dealt with is called "switch" set the switch variable to the counter/link number.
- }
- else if(primname == "all sides")
- {
- allsides = x; // etc
- }
- else if(primname == "detach")
- {
- detach = x; //etc
- }
- }
- }
- touch_end(integer num)
- {
- integer link = llDetectedLinkNumber(0); // check the link number of the prim touched.
- if(link == mesh)
- {
- // if the link touched is the same as the stored variable "mesh" do this
- }
- else if(link == mesh2)
- {
- // if the link touched is the same as the stored variable "mesh2" do that
- }
- else if(link == switch)
- {
- // if the link touched is the same as the stored variable "switch" do this thing
- }
- else if(link == allsides)
- {
- //etc
- // Do that thing
- }
- else if(link == detach)
- {
- //etc
- // Do the next thing
- }
- }
- changed(integer change)
- {
- if (change & CHANGED_OWNER | CHANGED_INVENTORY|CHANGED_LINK) // if the owner changes or another link is added to the prim set.
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement