The title is only a make-shift name, but this request was inspired by one comment on [url]www.garrysmod.org[/url] , saying: "Someone should try to mix this with the Dear Sister SWEP where after shooting them you shoot your own self." On this post: [url]http://www.garrysmod.org/downloads/?a=view&id=499[/url]. Now i'm a beginner on lua and I'm almost done scripting the suicide part, but how on earth would you combine that?
Or, make secondary suicide and primary shoot?
Bumped with hopefull intentions.
[highlight](User was banned for this post ("Useless bump" - mahalis))[/highlight]
Wait, so fully what do you want done? It would kill you and the person you shoot, or mirror damage, or what? Give me a little more detail here.
[QUOTE=nicatronTg;22676052]Wait, so fully what do you want done? It would kill you and the person you shoot, or mirror damage, or what? Give me a little more detail here.[/QUOTE]
You shoot a player/NPC, instant kill damage. Then, automatically after the player/NPC you shot dies, an animation plays and you shoot yourself. Possibly the animation used in this SWEP; [url]http://www.garrysmod.org/downloads/?a=view&id=101015[/url].
[QUOTE=Cysero;22676209]You shoot a player/NPC, instant kill damage. Then, automatically after the player/NPC you shot dies, an animation plays and you shoot yourself. Possibly the animation used in this SWEP; [url]http://www.garrysmod.org/downloads/?a=view&id=101015[/url].[/QUOTE]
Hmmm. I'm pretty sure that SWep is using IronSights to get into that position and not an Animation.
But for your problem couldn't you just have your shoot the bullet code (With very high damage if you want it a OHK.) and then this.
[lua]
timer.Simple(5,function()
-- The suicide function here.
end
[/lua]
[QUOTE=Dadalen;22698803]Hmmm. I'm pretty sure that SWep is using IronSights to get into that position and not an Animation.
But for your problem couldn't you just have your shoot the bullet code (With very high damage if you want it a OHK.) and then this.
[lua]
timer.Simple(5,function()
-- The suicide function here.
end
[/lua][/QUOTE]
Thanks.
So if I were to take the lua coding of another weapon, for say [i]Kermite's Trigun Revolver[/i] from his pistol pack, what part would I take out of it?
[lua]
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Weight = 5
SWEP.ViewModel = "models/weapons/v_pist_geagle.mdl"
SWEP.WorldModel = "models/weapons/w_pist_geagle.mdl"
SWEP.Category = "Kermite's Pistols Weapons"
SWEP.Primary.Sound = Sound("weapons/trigun/deagle-1.wav")
SWEP.Primary.Damage = 70
SWEP.Primary.Recoil = 0.75
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.017
SWEP.Primary.ClipSize = 6
SWEP.Primary.Delay = 0.05
SWEP.Primary.DefaultClip = 18
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "357"
SWEP.data = {}
SWEP.mode = "semi"
SWEP.data.semi = {}
SWEP.data.auto = {}
SWEP.IronSightsPos = Vector (6.6564, -3.1857, 3.0336)
SWEP.IronSightsAng = Vector (1.0894, -0.0521, 0)
function SWEP:Reload()
self.Weapon:DefaultReload(ACT_VM_RELOAD)
-- Animation when you're reloading
if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then
-- When the current clip < full clip and the rest of your ammo > 0, then
self.Owner:SetFOV( 0, 0.15 )
-- Zoom = 0
self:SetIronsights(false)
-- Set the ironsight to false
self.Weapon:EmitSound("weapons/trigun/magnumreload.wav")
end
end
function SWEP:Deploy()
self.Weapon:SendWeaponAnim( ACT_VM_DRAW )
self.Weapon:EmitSound("weapons/trigun/magnumdraw.wav")
self.Reloadaftershoot = CurTime() + 1
self.Weapon:SetNextPrimaryFire(CurTime() + 1)
return true
end
[/lua]
Would it be this part and this part combined?
[lua]SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Weight = 5
SWEP.ViewModel = "models/weapons/v_pist_geagle.mdl"
SWEP.WorldModel = "models/weapons/w_pist_geagle.mdl"
SWEP.Category = "Cysero's Beta weapons"
SWEP.Primary.Sound = Sound("weapons/trigun/deagle-1.wav")
SWEP.Primary.Damage = 900
SWEP.Primary.Recoil = 0.75
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.017
SWEP.Primary.ClipSize = 6
SWEP.Primary.Delay = 0.05
SWEP.Primary.DefaultClip = 18
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "357"
function SWEP:Deploy()
self.Weapon:SendWeaponAnim( ACT_VM_DRAW )
self.Weapon:EmitSound("weapons/trigun/magnumdraw.wav")
self.Reloadaftershoot = CurTime() + 1
self.Weapon:SetNextPrimaryFire(CurTime() + 1)
return true
end
timer.Simple(5,function()
function SWEP:PrimaryAttack()
if not self:CanPrimaryAttack() then return end
if ( !self.IronSightsPos ) then return end
bIronsights = !self.Weapon:GetNetworkedBool( "Ironsights", false )
self:SetIronsights( bIronsights )
timer.Simple( 1, function() self:Shoot() end)
return true
end
end[/lua]
?
Sorry, you need to Log In to post a reply to this thread.