generated from TAServers/template-gmod
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add files via upload * Add files via upload * removed the fast shotgun because it might be op for even truested and changed the dmg output of the gun * Fixed most of the comments on my PR * Made it so it gives you ammo * Added the resources * Added resource to a if server then * added a new swep called magic sword * added better instructions * Added InfoHud and updated weapon_magicsword * Removed unessary shit * fixed blockers and warnings --------- Co-authored-by: Derpius <49565664+Derpius@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
TASWeapons = { | ||
Category = "TAS Weapons", | ||
Authors = { Derpius = "Derpius", Kilo = "Kilo", El_Patito = "el_patito" }, --STEAM_0:0:547731733 Derpius, STEAM_0:0:84051936 Kilo, STEAM_0:0:572655757 el_patito_loco | ||
Authors = { | ||
Derpius = "Derpius", -- STEAM_0:0:547731733 Derpius | ||
Kilo = "Kilo", -- STEAM_0:0:84051936 Kilo | ||
El_Patito = "el_patito", -- STEAM_0:0:572655757 el_patito_loco | ||
yousifgaming = "yousifgaming", -- STEAM_0:0:193345966 yousifgaming | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
SWEP.PrintName = "Auto Shotgun" | ||
SWEP.Author = TASWeapons.Authors.yousifgaming | ||
SWEP.Instructions = "Gotta Go Faster" | ||
SWEP.Purpose = "To play with dingus" | ||
SWEP.Contact = "Don't Contact me i dont like people" | ||
|
||
SWEP.Category = TASWeapons.Category | ||
SWEP.Spawnable = true | ||
SWEP.AdminOnly = false | ||
SWEP.BounceWeaponIcon = false | ||
SWEP.IconOverride = "autoshotgun/cat.jpg" | ||
if CLIENT then | ||
local TextureName = "autoshotgun/cat" | ||
SWEP.IconOverride = TextureName | ||
SWEP.WepSelectIcon = surface.GetTextureID(TextureName) | ||
killicon.Add("weapon_autoshotgun", TextureName, Color(255, 255, 255)) | ||
end | ||
|
||
SWEP.Primary.ClipSize = 30 | ||
SWEP.Primary.DefaultClip = 56 | ||
SWEP.Primary.Automatic = true | ||
SWEP.Primary.Ammo = "Buckshot" | ||
|
||
SWEP.Secondary.Ammo = "None" | ||
SWEP.Secondary.Automatic = true | ||
|
||
SWEP.ReloadInProgress = false | ||
|
||
SWEP.Weight = 5 | ||
SWEP.AutoSwitchTo = false | ||
SWEP.AutoSwitchFrom = false | ||
|
||
SWEP.Slot = 3 | ||
SWEP.SlotPos = 0 | ||
SWEP.DrawAmmo = true | ||
SWEP.DrawCrosshair = true | ||
|
||
SWEP.ViewModel = "models/weapons/c_shotgun.mdl" | ||
SWEP.WorldModel = "models/weapons/w_shotgun.mdl" | ||
SWEP.UseHands = true | ||
|
||
SWEP.ShootSound = Sound("weapons/xm1014/xm1014-1.wav") | ||
|
||
if SERVER then | ||
resource.AddFile("materials/autoshotgun/cat.vmt") | ||
resource.AddFile("materials/autoshotgun/cat.jpg") | ||
end | ||
|
||
function SWEP:Initialize() | ||
self:SetHoldType("shotgun") | ||
end | ||
|
||
function SWEP:PrimaryAttack() | ||
if not self:CanPrimaryAttack() then | ||
return | ||
end | ||
|
||
self:SetNextPrimaryFire(CurTime() + 0.5) | ||
self:SetNextSecondaryFire(CurTime() + 1) | ||
|
||
self:ShootBullet(10, 10, 0.1) | ||
|
||
self:EmitSound(self.ShootSound) | ||
|
||
self:TakePrimaryAmmo(1) | ||
end | ||
|
||
function SWEP:SecondaryAttack() | ||
if self:Clip1() < 3 then | ||
self:SetNextSecondaryFire(CurTime() + 0.3) | ||
self:Reload() | ||
return | ||
end | ||
|
||
self:SetNextPrimaryFire(CurTime() + 1) | ||
self:SetNextSecondaryFire(CurTime() + 1) | ||
|
||
self:ShootBullet(10, 30, 0.1) | ||
self:EmitSound(self.ShootSound) | ||
|
||
self:TakePrimaryAmmo(3) | ||
end | ||
|
||
function SWEP:Reload() | ||
local ply = self:GetOwner() | ||
local roundsToReload = self.Primary.ClipSize - self:Clip1() | ||
if | ||
self:GetOwner():GetAmmoCount(self:GetPrimaryAmmoType()) <= 0 | ||
or self:Clip1() >= self.Primary.ClipSize | ||
or self.ReloadInProgress | ||
then | ||
return | ||
end | ||
|
||
if ply:GetAmmoCount(self:GetPrimaryAmmoType()) < roundsToReload then | ||
roundsToReload = ply:GetAmmoCount(self:GetPrimaryAmmoType()) | ||
end | ||
|
||
if roundsToReload <= 0 then | ||
return | ||
end | ||
|
||
self.ReloadInProgress = true | ||
|
||
self:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) | ||
self:SetNextPrimaryFire(CurTime() + self:SequenceDuration()) | ||
|
||
timer.Simple(self:SequenceDuration(), function() | ||
if IsValid(self) and IsValid(self:GetOwner()) then | ||
self:SendWeaponAnim(ACT_SHOTGUN_RELOAD_FINISH) | ||
self:DefaultReload(380) | ||
self:EmitSound("weapons/shotgun/shotgun_reload" .. math.random(1, 3) .. ".wav") | ||
self:SetClip1(self:Clip1() + roundsToReload) | ||
self:GetOwner():RemoveAmmo(roundsToReload, self:GetPrimaryAmmoType()) | ||
self.ReloadInProgress = false | ||
end | ||
end) | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"UnlitGeneric" | ||
{ | ||
"$basetexture" "autoshotgun/cat" | ||
} |
Binary file not shown.