Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

how do i set it to user only

Robert Brearly
Sword Crafter
Join date: 15 Feb 2005
Posts: 8
02-19-2005 21:09
I have a weapon that has a particle effect, when i type on or off, it turns on and off. but other people can do it too, how can I make it so only I can turn it on and off
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
02-20-2005 04:29
Heya,

Providing you can access the script in side your weapon then this should help you.

You need to set the listen to owner only.

Here is an example:


CODE


integer listenID;

default
{
state_entry()
{
//Note the llGetOwner().
listenID = llListen(11, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
//listen event
}
on_rez(integer start_param)
{
llResetScript();
}
}




The reason for this is your listen is open for public use as well as on channel 0.

Recommendations are to change the channel off of 0, In the example the channel is set to 11.

You will also see the example has been set to listen to owner only using llGetOwner().

The listen in your script may look like llListen(0, "", "", "";); or llListen(0, "", NULL_KEY, "";);

eitherway that means your set for public use.

Hope that helps.

Jason.
_____________________
Need help understanding Secondlife scripting language?
Check here
Robert Brearly
Sword Crafter
Join date: 15 Feb 2005
Posts: 8
hmm
02-20-2005 08:38
should i put this in the same script as the particles, or a new script?