Files
VnUtest/garrysmod/addons/tacrp/lua/weapons/tacrp_knife.lua
2026-03-31 10:27:04 +03:00

101 lines
2.2 KiB
Lua

SWEP.Base = "tacrp_base_knife"
SWEP.Spawnable = true
AddCSLuaFile()
// names and stuff
SWEP.PrintName = "Flip Knife"
SWEP.Category = "[FT] Специальное Оружие"
SWEP.SubCatTier = "9Special"
SWEP.SubCatType = "8Bladed Melee"
SWEP.Description = "A multi-purpose flip knife, although most of the purposes involving stabbing someone."
SWEP.Description_Quote = "Stabbin' time."
SWEP.Faction = TacRP.FACTION_COALITION
SWEP.Credits = "Assets: Tactical Intervention"
SWEP.ViewModel = "models/weapons/tacint/v_knife.mdl"
SWEP.WorldModel = "models/weapons/tacint/w_knife.mdl"
SWEP.Slot = 0
SWEP.MeleeDamage = 35
SWEP.MeleeAttackTime = 0.4
SWEP.MeleeAttackMissTime = 0.5
SWEP.MeleeDelay = 0.15
SWEP.MeleeDamageType = DMG_SLASH
SWEP.MeleePerkStr = 0.5
SWEP.MeleePerkAgi = 0.5
SWEP.MeleePerkInt = 0.5
// hold types
SWEP.HoldType = "knife"
SWEP.HoldTypeSprint = "knife"
SWEP.GestureBash = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE
SWEP.GestureBash2 = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
SWEP.PassiveAng = Angle(-2.5, 0, 0)
SWEP.PassivePos = Vector(1, 0, -5)
SWEP.SprintAng = Angle(0, 0, 0)
SWEP.SprintPos = Vector(2, 0, -5)
SWEP.CustomizeAng = Angle(0, 25, 0)
SWEP.CustomizePos = Vector(2, 0, -12)
SWEP.SprintMidPoint = {
Pos = Vector(2, 0, -5),
Ang = Angle(0, 0, 0)
}
// sounds
local path = "tacrp/weapons/knife/"
SWEP.AnimationTranslationTable = {
["deploy"] = "deploy",
["melee"] = {"slash_left1", "slash_left2", "slash_right1", "slash_right2"},
["melee2"] = {"slash_forward1", "slash_forward2"},
["meleethrow"] = {"knifethrow"},
}
SWEP.Sound_MeleeHit = {
path .. "/scrape_metal-1.wav",
path .. "/scrape_metal-2.wav",
path .. "/scrape_metal-3.wav",
}
SWEP.Sound_MeleeHitBody = {
path .. "/flesh_hit-1.wav",
path .. "/flesh_hit-2.wav",
path .. "/flesh_hit-3.wav",
path .. "/flesh_hit-4.wav",
path .. "/flesh_hit-5.wav",
}
SWEP.Sound_MeleeSwing = {
path .. "swing-1.wav",
path .. "swing-2.wav",
path .. "swing-3.wav",
path .. "swing-4.wav",
path .. "swing-5.wav",
path .. "swing-6.wav",
}
local function addsound(name, spath)
sound.Add({
name = name,
channel = 16,
volume = 1.0,
sound = spath
})
end
addsound("tacint_knife.deploy", path .. "open-1.wav")