Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Example Code Needed Please

BioMolecular Chemistry
Registered User
Join date: 16 Apr 2008
Posts: 24
04-22-2008 04:59
Howdy, trying to make a bullet for my gun that applies vertical push only to the target avatar. I'm not looking at creating a griefing weapon just one that myself and consenting avatars can use in a push enabled combat sim. The highest amount of vertical push achievable would be preferred. I already have a gun script, just need a push (pardon the pun) in the right direction. Please assist???
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
04-22-2008 05:05
Should be something like

llPushObject(llDetectedKey(0), <0,0,2147483647>, <0,0,0>, FALSE);


repeating this line several times, may help make it more effective.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
BioMolecular Chemistry
Registered User
Join date: 16 Apr 2008
Posts: 24
Thanks Winter But...
04-22-2008 05:40
This is what I'm using, I put that llPushObject line in, however I am not getting any push at all

//
// Bolter Round
//

vector velocity;
integer shot = FALSE;
integer fade = FALSE;
float alpha = 1.0;
float damage = 0;
float hitpower = 0;
float lifetime = 10;

default
{
state_entry()
{

}

on_rez(integer start_param)
{
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
llSetBuoyancy(1.0);
llCollisionSound("", 1.0); // Disable collision sounds
velocity = llGetVel() * 5;
float vmag;
vmag = llVecMag(velocity);
if (vmag > 0.1) shot = TRUE;
llSetTimerEvent(lifetime);
}

collision_start(integer total_number)
{
llPushObject(llDetectedKey(0), <0,0,2147483647>, <0,0,0>, FALSE);
llDie();
}

timer()
{
if (!fade)
{
if (shot)
{
llDie();
}
}
else
{
llSetAlpha(alpha, -1);
alpha = alpha * 0.999999;
if (alpha < 0.1)
{
llDie();
}
}
}
}
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
04-22-2008 08:16
llPushObject seems to be broken right now. Everything I have that uses it (even on myself, or anyone in a non-push-restricted area) doesn't seem to work.
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
04-22-2008 08:55
All you need is: http://rpgstats.com/wiki/index.php?title=ExampleGun