Skip to content

Commit

Permalink
Merge pull request #7 from adamnejm/hands-swep
Browse files Browse the repository at this point in the history
Add Hands SWEP
  • Loading branch information
Derpius authored Dec 15, 2023
2 parents 3d66bb0 + 80cf229 commit f9d4bce
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions lua/weapons/hands.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SWEP.PrintName = "Hands"
SWEP.Author = "TAS Team"
SWEP.Contact = "https://taservers.com/"
SWEP.Instructions =
"Right-click while walking and crouching to toggle the crosshair"
SWEP.IconOverride = "entities/weapon_fists.png"
SWEP.Spawnable = true
SWEP.AdminSpawnable = false

SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.HoldType = "normal"
SWEP.ViewModel = "models/weapons/c_arms.mdl"
SWEP.Primary.Ammo = "none"
SWEP.Secondary.Ammo = "none"

if CLIENT then
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true

function SWEP:DrawWorldModel() end
function SWEP:DrawWorldModelTranslucent() end
else
function SWEP:ShouldDropOnDie()
return false
end

function SWEP:OnDrop()
self:Remove()
end
end

function SWEP:Initialize()
self:DrawShadow(false)
self:SetHoldType("normal")
self:SetSequence("ragdoll") -- Along with the viewmodel, makes the hands invisible
end

function SWEP:PrimaryAttack() end
function SWEP:SecondaryAttack()
if
not IsFirstTimePredicted()
or not self:GetOwner():IsWalking()
or not self:GetOwner():Crouching()
then
return
end
self.DrawCrosshair = not self.DrawCrosshair
self:SetNextSecondaryFire(CurTime() + 0.3)
end

0 comments on commit f9d4bce

Please sign in to comment.