Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer PowerOn;
- HideButton()
- {
- llSetLinkPrimitiveParamsFast(3, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,0.0,PRIM_SIZE,<0.0,0.0,0.0>]);
- llSetLinkPrimitiveParamsFast(4, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,0.0,PRIM_SIZE,<0.0,0.0,0.0>]);
- }
- ShowButton()
- {
- llSetLinkPrimitiveParamsFast(3, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,1.0]);
- llSetLinkPrimitiveParamsFast(4, [PRIM_COLOR,ALL_SIDES,<0.0,1.0,0.0>,1.0]);
- llSleep(0.1);
- llSetLinkPrimitiveParamsFast(3, [PRIM_SIZE,<0.48,0.48,0.0>]);
- llSetLinkPrimitiveParamsFast(4, [PRIM_SIZE,<0.48,0.48,0.0>]);
- }
- default
- {
- state_entry()
- {
- HideButton();
- }
- touch_end(integer total_number)
- {
- PowerOn = !PowerOn;
- integer touched = llDetectedLinkNumber(0);
- llOwnerSay((string)touched);
- if (PowerOn && touched == 2|5|6)
- {
- llSetLinkPrimitiveParamsFast(5, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.05]);
- llSetLinkPrimitiveParamsFast(6, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.05]);
- ShowButton();
- }
- if (!PowerOn && touched == 2|5|6)
- {
- llSetLinkPrimitiveParamsFast(5, [PRIM_COLOR,ALL_SIDES,<1.0,1.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.0]);
- llSetLinkPrimitiveParamsFast(6, [PRIM_COLOR,ALL_SIDES,<1.0,1.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.0]);
- HideButton();
- }
- if (touched == 3)
- {
- llOwnerSay("Red");
- }
- if (touched == 4)
- {
- llOwnerSay("Green");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement