Jump to content

Transparency Script (Not SetAlpha)


DJxPurity
 Share

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

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

Recommended Posts

I am looking for a simple code that changes a prim between 0% transparency and 99% transparency using a chat command like /5 0 for not transparent and /5 99 for 99% transparency. I have searched high and low on the lsl library and it keeps bringing me to complicated scripts that I don't need or SetAlpha scripts. I don't want to have to change the transparency in the texture menu, it needs to be script based for my idea to work. 

The thing is, I'm not looking for SetAlpha codes, because I don't want my prim to go 100% transparent because it'll ruin the concept of my idea. And that's literally all I want the script to do is change between those two transparency percentages on chat command. 

Can someone help me out on this? Thanks. 

Link to comment
Share on other sites


DJxPurity wrote:

I am looking for a simple code that changes a prim between 0% transparency and 99% transparency using a chat command like /5 0 for not transparent and /5 99 for 99% transparency. I have searched high and low on the lsl library and it keeps bringing me to complicated scripts that I don't need or SetAlpha scripts. I don't want to have to change the transparency in the texture menu, it needs to be script based for my idea to work. 

The thing is, I'm not looking for SetAlpha codes, because I don't want my prim to go 100% transparent because it'll ruin the concept of my idea. And that's literally all I want the script to do is change between those two transparency percentages on chat command. 

Can someone help me out on this? Thanks. 

I think what you are looking for is a SetAlpha script.   The setting is a float number in the range 0.0 to 1.0.   Which is like setting the transparency from 100% transparent to 0% transparent.  

Hint: set alpha to 0.5 is 50% transparent.

Addditional hints: 

alpha set to 1.0    is   0    percent transparent

alpha set to 0.01  is  99   percent transparent

edited to give additional hints

(1 - alpha setting) * 100 = percentage transparent

Link to comment
Share on other sites

SetAlpha is the transparncy. needs to be tighter on the listen, but did it fast

default{	state_entry()	{		llListen(5,"", "", "");	}	listen(integer channel, string name, key id, string message)	{		if(channel==5 && message == "on")//     /5 on		{			llSetAlpha(1.0, ALL_SIDES);		}		else if(channel==5 && message== "off")		{			llSetAlpha(0.1, ALL_SIDES);		}	}}

 

Link to comment
Share on other sites

I appreciate the help on the SetAlpha, unfortunately, it doesn't quite bring me up to 99%, which is necessary for my project. I will remember those values for the future. 


steph Arnott wrote:

SetAlpha is the transparncy. needs to be tighter on the listen, but did it fast
default{	state_entry()	{		llListen(5,"", "", "");	}	listen(integer channel, string name, key id, string message)	{		if(channel==5 && message == "on")//     /5 on		{			llSetAlpha(1.0, ALL_SIDES);		}		else if(channel==5 && message== "off")		{			llSetAlpha(0.1, ALL_SIDES);		}	}}

 

 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...