Traitor's death
Innocent If you do not die
Weapons Where is the problem?
if SERVER then
AddCSLuaFile( "shared.lua" )
end
SWEP.HoldType= "pistol"
if CLIENT then
SWEP.PrintName = "name"
SWEP.Author= ""
SWEP.Slot= 6
SWEP.SlotPos= 0
SWEP.EquipMenuData = {
type="name",
model="models/weapons/w_pist_deagle.mdl",
desc=""
};
SWEP.Icon = "VGUI/ttt/icon_goldengun"
end
SWEP.Base= "weapon_tttbase"
SWEP.Primary.Ammo = "RPG_Round" -- hijack an ammo type we don't use otherwise
SWEP.Primary.Recoil = 1.3
SWEP.Primary.Damage = 1
SWEP.Primary.Delay = 2
SWEP.Primary.Cone = 0.02
SWEP.Primary.DefaultClip = 1
SWEP.Primary.ClipSize = 1
SWEP.Primary.Automatic = false
SWEP.Kind = WEAPON_EQUIP1
SWEP.CanBuy = { ROLE_DETECTIVE }
SWEP.LimitedStock = true
SWEP.AmmoEnt = nil
SWEP.IsSilent = false
SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK
SWEP.ReloadAnim = ACT_VM_RELOAD
SWEP.AutoSpawnable = false
SWEP.Primary.Sound = Sound( "Weapon_Deagle.Single" )
SWEP.ViewModel = "models/weapons/v_powerdeagle.mdl"
SWEP.WorldModel = "models/weapons/w_powerdeagle.mdl"
SWEP.IronSightsPos = Vector( 5.15, -2, 2.6 )
function SWEP:PrimaryAttack()
if not self:CanPrimaryAttack() then return end
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
local trace = util.GetPlayerTrace(self.Owner)
local tr = util.TraceLine(trace)
if tr.Entity:IsPlayer() then
if tr.Entity:IsRole(ROLE_TRAITOR) then
bullet = {}
bullet.Num = 1
bullet.Src = self.Owner:GetShootPos()
bullet.Dir = self.Owner:GetAimVector()
bullet.Spread = Vector(0, 0, 0)
bullet.Tracer = 0
bullet.Force = 3000
bullet.Damage = 4000
self.Owner:FireBullets(bullet)
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:TakePrimaryAmmo(1)
self.Weapon:EmitSound(Sound( "Weapon_Deagle.Single" ))
end
if tr.Entity:IsRole(ROLE_INNOCENT) or tr.Entity:IsRole(ROLE_DETECTIVE) then
self.Owner:Kill()
self.Weapon:EmitSound(Sound( "Weapon_Deagle.Single" ))
self:TakePrimaryAmmo(1)
end
end
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:TakePrimaryAmmo(1)
self.Owner:EmitSound(Sound( "Weapon_Deagle.Single" ))
end
if !self:CanPrimaryAttack() then return end
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self.Owner:EmitSound(Sound( "Weapon_Deagle.Single" ))
self:TakePrimaryAmmo(1)
local trace = util.GetPlayerTrace(self.Owner)
local tr = util.TraceLine(trace)
if tr.Entity:IsPlayer() then
if tr.Entity:IsActiveTraitor() then
tr.Entity:TakeDamage(1000, self.owner, weapon_ttt_tester)
else
tr.Entity:TakeDamage(0, self.owner, weapon_ttt_tester)
end
end
end
function SWEP:SecondaryAttack()
return
end
Sorry, you need to Log In to post a reply to this thread.