// Variables that are used on both client and server SWEP.Author = "Pepperdyne" SWEP.Purpose = "Sacrifice yourself for Moe." SWEP.Instructions = "Left Click to make yourself EXPLODE." SWEP.DrawCrosshair = false SWEP.EquipMenuData = { type="Weapon", model="models/weapons/v_jb.mdl", desc="Kills yourself and others around you with the power of MOE :3" }; SWEP.Spawnable = true SWEP.AdminSpawnable = true // Spawnable in singleplayer or by server admins SWEP.ViewModel = "models/weapons/v_jb.mdl" SWEP.WorldModel = "models/weapons/w_jb.mdl" SWEP.AllowDrop = false SWEP.PrintName = "Mio's Secret Weapon" SWEP.Base = "weapon_tttbase" SWEP.Slot = 7 SWEP.Kind = WEAPON_ROLE SWEP.CanBuy = { ROLE_TRAITOR } SWEP.GroupOnly = false; SWEP.Groups = {"vip", "admin", "ducklord", "superadmin"}; SWEP.Icon = "vgui/entities/weapon_moe" SWEP.Spawnable = true SWEP.Primary.ClipSize = -1 SWEP.Primary.DefaultClip = -1 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "none" SWEP.Primary.Delay = 3 function SWEP:OnRemove() if CLIENT and IsValid(self.Owner) and self.Owner == LocalPlayer() and self.Owner:Alive() then RunConsoleCommand("lastinv") end end function SWEP:OnDrop() self:Remove() end /*--------------------------------------------------------- Reload does nothing ---------------------------------------------------------*/ function SWEP:Reload() end function SWEP:Initialize() util.PrecacheSound("siege/moe_explosion.wav") util.PrecacheSound("siege/moe.wav") end /*--------------------------------------------------------- Think does nothing ---------------------------------------------------------*/ function SWEP:Think() end /*--------------------------------------------------------- PrimaryAttack ---------------------------------------------------------*/ function SWEP:PrimaryAttack() self.Weapon:SetNextPrimaryFire(CurTime() + 3) local effectdata = EffectData() effectdata:SetOrigin( self.Owner:GetPos() ) effectdata:SetNormal( self.Owner:GetPos() ) effectdata:SetMagnitude( 15 ) effectdata:SetScale( 1 ) effectdata:SetRadius( 70 ) util.Effect( "Sparks", effectdata ) self.BaseClass.ShootEffects( self ) // The rest is only done on the server if (SERVER) then timer.Simple(4, function() self:Asplode() end ) self.Owner:EmitSound( "siege/moe.wav" ) end end --The asplode function function SWEP:Asplode() local k, v // Make an explosion at your position local ent = ents.Create( "env_explosion" ) ent:SetPos( self.Owner:GetPos() ) ent:SetOwner( self.Owner ) ent:Spawn() ent:SetKeyValue( "iMagnitude", "300" ) ent:Fire( "Explode", 0, 0 ) ent:EmitSound( "siege/moe_explosion.wav", 500, 500 ) self.Owner:Kill( ) for k, v in pairs( player.GetAll( ) ) do v:ConCommand( "play siege/moe_explosion.wav\n" ) end end