Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- easylua.StartWeapon("weapon_barcrow")
- SWEP.Base = "weapon_base"
- SWEP.PrintName = "BARCROW"
- SWEP.Slot = 0
- SWEP.SlotPos = 0
- SWEP.DrawWeaponInfoBox = false
- SWEP.ViewModel = "models/weapons/v_crowbar.mdl"
- SWEP.WorldModel = "models/weapons/w_crowbar.mdl"
- SWEP.ViewModelFOV = 54
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.SwingSound = "Weapon_Crowbar.Single"
- SWEP.HitSound = "Weapon_Crowbar.Melee_Hit"
- SWEP.HoldType = "melee"
- SWEP.Delay = 0.4
- SWEP.Range = 75
- SWEP.Damage = 25
- SWEP.ActivityTranslateAI =
- {
- [ACT_STAND] = ACT_IDLE_MELEE,
- [ACT_IDLE_ANGRY] = ACT_IDLE_ANGRY_MELEE,
- [ACT_MP_RUN] = ACT_HL2MP_RUN_MELEE,
- [ACT_MP_CROUCHWALK] = ACT_HL2MP_WALK_CROUCH_MELEE,
- [ACT_MELEE_ATTACK1] = ACT_MELEE_ATTACK1,
- [ACT_RELOAD] = ACT_RELOAD,
- }
- function SWEP:Initialize()
- self:SetWeaponHoldType(self.HoldType)
- end
- function SWEP:PrimaryAttack()
- local owner = self.Owner
- local forward = owner:GetAimVector()
- local trace = {}
- trace.start = owner:EyePos()
- trace.endpos = owner:EyePos() + (forward * self.Range)
- trace.filter = {owner}
- trace.mins = Vector(1, 1, 1) * -8
- trace.maxs = Vector(1, 1, 1) * 8
- trace = util.TraceHull(trace)
- local ent = trace.Entity
- if SERVER and ent:IsValid() and ent:IsPlayer() and ent:GetInfo("cl_dmg_mode") ~= "3" then
- self:SetNextPrimaryFire(CurTime() + self.Delay)
- return false
- end
- if trace.Hit then
- if SERVER and not trace.HitWorld and ent:IsValid() then
- local params = DamageInfo()
- params:SetAttacker(owner)
- params:SetInflictor(self)
- params:SetDamage(self.Damage)
- params:SetDamageForce(forward * self.Damage * 700)
- params:SetDamagePosition(trace.HitPos)
- params:SetDamageType(DMG_SLASH)
- ent:TakeDamageInfo(params)
- if ent:GetPhysicsObject():IsValid() then
- ent:SetPhysicsAttacker(self.Owner)
- end
- end
- self:SendWeaponAnim(ACT_VM_HITCENTER)
- self:EmitSound(self.HitSound)
- else
- self:SendWeaponAnim(ACT_VM_MISSCENTER)
- self:EmitSound(self.SwingSound)
- end
- self:SetNextPrimaryFire(CurTime() + self.Delay)
- self.Owner:SetAnimation(PLAYER_ATTACK1)
- end
- function SWEP:SecondaryAttack()
- return false
- end
- function SWEP:DrawWeaponSelection(x,y,w,t,a)
- draw.SimpleText("c", "TitleFont2", x + w / 2, y, Color(255, 255, 255, a), TEXT_ALIGN_CENTER)
- end
- function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha)
- surface.SetDrawColor( color_transparent )
- surface.SetTextColor( 255, 220, 0, alpha )
- surface.SetFont( "TitleFont2" )
- local w, h = surface.GetTextSize( "c" )
- surface.SetTextPos( x + ( wide / 2 ) - ( w / 2 ), y + ( tall / 2 ) - ( h / 2 ) )
- surface.DrawText( "c" )
- end
- function SWEP:GetCapabilities()
- return bit.bor(CAP_WEAPON_MELEE_ATTACK1 , CAP_INNATE_MELEE_ATTACK1)
- end
- easylua.EndWeapon(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement