Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(SERVER) then
- function SWEP:Deploy()
- local idx = self.Owner:EntIndex()
- local hk = "swepcheckjump" .. idx
- self:CallOnRemove("cleanupswepcheckjump",hook.Remove,"KeyPress",hk)
- hook.Add("KeyPress",hk,function(pl,key)
- if(pl == self.Owner && key == IN_JUMP) then
- self:OnOwnerJumped()
- end
- end)
- return true
- end
- function SWEP:OnOwnerJumped()
- self.Owner:EmitSound("path/to/sound",75,100)
- end
- function SWEP:Holster()
- local idx = self.Owner:EntIndex()
- local hk = "swepcheckjump" .. idx
- self:RemoveCallOnRemove("cleanupswepcheckjump")
- hook.Remove("KeyPress",hk)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement