Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Barrle flash script

Billybob Street
Registered User
Join date: 18 Aug 2004
Posts: 26
08-14-2005 22:08
Can someone plz give me a script when you shoot the gun a flash comes out of the barrle i alrdy have the right textures for it just cant make the script thanks.
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
08-14-2005 23:25
Build the muzzle flash into your gun, texture it, and add this script into each of its prims:
CODE

float delay = 0.1;
float alpha;

default
{
state_entry()
{
alpha = llGetAlpha(ALL_SIDES);
llSetAlpha(0.0, ALL_SIDES);
}

link_message(integer part, integer num, string msg, key id)
{
if (msg == "f")
{
llSetAlpha(alpha, ALL_SIDES);
llSleep(delay);
llSetAlpha(0.0, ALL_SIDES);
}
}
}

And modify the gun's main script so that whenever the gun fires, just before rezzing the bullet, have it send a link message containing string "f". Tweak the value of "delay" until it looks right to you.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Blain Candour
Registered User
Join date: 17 Jun 2005
Posts: 83
08-14-2005 23:27
------ removed post--------- Above answer will work fine for you if you have prim muzzle flash.