Can someone tell me why the llRegionSay() in this script is not transmitting anything? I've put debug statements in it and have verified 100% that its being called when it impacts an avatar. An llOwnerSay() call right one line above it dumps the msg out just fine, but the llRegionSay() sends nothing. llSay() also fails to transmit. I tried delaying the bullet a few seconds before it deletes itself to see if its a timing thing. The call still failed to transmit. integer WEAPON_CHANNEL = -12020423;
integer timerTicks = 0;
float LIFETIME = 5.0;
float BASEVELOCITY = 50;
init() {
//Preset the needed settings.
llSetBuoyancy(1.0);
llSetPrimitiveParams([PRIM_TEMP_ON_REZ, TRUE, PRIM_PHYSICS, TRUE]);
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
llCollisionSound("", 0.0);
}
remove() {
//Remove the bullet.
llSetStatus(STATUS_PHYSICS, FALSE);
llSetAlpha(0.0, ALL_SIDES);
llDie();
}
setVelocity(float velocity) {
//Applies the correct impulse to the bullet
vector vect = ((<velocity,0,0> - llGetVel() / llGetRot()) * llGetMass());
llApplyImpulse(vect,TRUE);
}
default {
state_entry() {
init();
}
on_rez(integer start_param) {
//The bullet has been fired.
//Sets the bullet in motion at the correct velocity in meters per second.
setVelocity( (((float)start_param / 100) * BASEVELOCITY) );
llSetTimerEvent(LIFETIME);
}
collision_start(integer total_number) {
key avatarKey = llDetectedKey(0);
key ownerKey = llGetOwner();
if (avatarKey != ownerKey) {
string msg = "BulletImpact, " + (string) avatarKey;
llRegionSay(WEAPON_CHANNEL, msg);
remove();
}
}
land_collision_start(vector pos) {
remove();
}
timer() {
remove();
}
}