Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- decoy_model <- @"models/weapons/w_eq_decoy_thrown.mdl";
- decoy_duration <- 10
- function Precache()
- {
- self.PrecacheModel(decoy_model);
- }
- function Think()
- {
- local decoy = null;
- while((decoy = Entities.FindByClassname(decoy, "decoy_projectile")) != null)
- {
- if(decoy.GetVelocity().Length() == Vector(0,0,0).Length())
- {
- gunfire <- Entities.CreateByClassname("env_gunfire");
- //gunfire.__KeyValueFromInt("iMinBurstSize", 50);
- //gunfire.__KeyValueFromInt("iMaxBurstSize", 50);
- //gunfire.__KeyValueFromInt("iMinDelayBetweenBursts", 50);
- //gunfire.__KeyValueFromInt("iMaxDelayBetweenBursts", 50);
- //gunfire.__KeyValueFromString("Weapon", Nova);
- local origin = decoy.GetOrigin();
- local angles = decoy.GetAngles();
- local model = CreateProp("prop_dynamic_override", origin, decoy_model, 0);
- model.SetAngles(angles.x, angles.y, angles.z);
- gunfire.SetOrigin(origin);
- decoy.Destroy();
- EntFireByHandle(gunfire, "Enable","",0.1, null, null);
- EntFireByHandle(gunfire, "Kill", "", decoy_duration, null, null);
- EntFireByHandle(model, "Kill", "", decoy_duration, null, null);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement