Okay Guys So i was looking about and i put togather this Jihad bomb... It doesnt work cause when i try giving myself it this happens: Attempted to create unknown entity type weapon_ttt_jihad! NULL Ent in GiveNamedItem!
Help? Is the Script Totaly Wrong? Or is it a small mistake i made if so can u correct it For me Or Something Cheers.
-- traitor equipment: Jihad Bomb
if SERVER then AddCSLuaFile( "shared.lua" ) end
SWEP.HoldType = "slam"
if CLIENT then SWEP.PrintName = "Jihad Bomb" SWEP.Instructions = "Ka-Boom" SWEP.Slot = 6 SWEP.SlotPos = 0 SWEP.IconLetter = "j"
SWEP.EquipMenuData = { type="Weapon", model="models/weapons/w_jb.mdl", name="Jihad", desc="Powerful explosive./nScream at your Enemies xD." };
SWEP.Icon = "VGUI/ttt/icon_jihad" end
SWEP.Base = "weapon_tttbase"
SWEP.Kind = WEAPON_EQUIP SWEP.CanBuy = {ROLE_TRAITOR} -- only traitors can buy SWEP.WeaponID = WEAPON_NONE
Reload does nothing ---------------------------------------------------------*/ function SWEP:Reload() end
function SWEP:Initialize() util.PrecacheSound("siege/big_explosion.wav") util.PrecacheSound("siege/jihad.wav") end
/*--------------------------------------------------------- Think does nothing ---------------------------------------------------------*/ function SWEP:Think() end
/*--------------------------------------------------------- PrimaryAttack ---------------------------------------------------------*/ function SWEP:PrimaryAttack() self.Weapon:SetNextPrimaryFire(CurTime() + 3)
// The rest is only done on the server if (SERVER) then timer.Simple(2, function() self:Asplode() end ) self.Owner:EmitSound( "siege/jihad.wav" ) end
end
--The asplode function function SWEP:Asplode() local k, v
// Make an explosion at your position local ent = ents.Create( "env_explosion" ) ent:SetPos( self.Owner:GetPos() ) ent:SetOwner( self.Owner ) ent:Spawn() ent:SetKeyValue( "iMagnitude", "250" ) ent:Fire( "Explode", 0, 0 ) ent:EmitSound( "siege/big_explosion.wav", 500, 500 )
self.Owner:Kill( ) self.Owner:AddFrags( -1 )
for k, v in pairs( player.GetAll( ) ) do v:ConCommand( "play siege/big_explosion.wav\n" ) end
end
/*--------------------------------------------------------- SecondaryAttack ---------------------------------------------------------*/ function SWEP:SecondaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + 1 )
local TauntSound = Sound( "vo/npc/male01/overhere01.wav" )
self.Weapon:EmitSound( TauntSound )
// The rest is only done on the server if (!SERVER) then return end
hey guys, im wondering how to you make a custom weapon which is like a dead body on the floor which is fake and when you press E you lose Some Damage or something can someone make 1 for me or give me a hand?