I began making a custom weapon for TTT earlier today and it works perfectly other than the fact that I don't know how to make it burst fire. Here's the code:
---- Example TTT custom weapon
-- First some standard GMod stuff
if SERVER then
AddCSLuaFile( "shared.lua" )
end
if CLIENT then
SWEP.PrintName = "Decimator"
SWEP.Slot = 6 -- add 1 to get the slot number key
SWEP.ViewModelFOV = 72
SWEP.ViewModelFlip = true
end
-- Always derive from weapon_tttbase.
SWEP.Base = "weapon_tttbase"
--- Standard GMod values
SWEP.HoldType = "pistol"
SWEP.Primary.Delay = 0.03
SWEP.Primary.Recoil = 3.5
SWEP.Primary.Automatic = true
SWEP.Primary.Damage = 20
SWEP.Primary.Cone = 0.01
SWEP.Primary.Ammo = "smg1"
SWEP.Primary.ClipSize = 15
SWEP.Primary.ClipMax = 30
SWEP.Primary.DefaultClip = 15
SWEP.Primary.Sound = Sound( "Weapon_tmp.Single" )
SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 )
SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 )
SWEP.ViewModel = "models/weapons/v_smg_tmp.mdl"
SWEP.WorldModel = "models/weapons/w_smg_tmp.mdl"
--- TTT config values
-- Kind specifies the category this weapon is in. Players can only carry one of
-- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP or ROLE.
-- The last two will not auto pickup when a player walks over them.
SWEP.Kind = WEAPON_EQUIP
-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP, then this gun can
-- be spawned as a random weapon. Of course this AK is of the type WEAPON_EQUIP,
-- but for the sake of example this is set to false anyway.
SWEP.AutoSpawnable = false
-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
SWEP.AmmoEnt = "item_ammo_smg1_ttt"
-- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If
-- a role is in this table, those players can buy this.
SWEP.CanBuy = { ROLE_TRAITOR }
-- InLoadoutFor is a table of ROLE_* entries that specifies which roles should
-- receive this weapon as soon as the round starts. In this case, none.
SWEP.InLoadoutFor = nil
-- If LimitedStock is true, you can only buy one per round.
SWEP.LimitedStock = false
-- If AllowDrop is false, players can't manually drop the gun with Q
SWEP.AllowDrop = true
-- If IsSilent is true, victims will not scream upon death.
SWEP.IsSilent = true
-- If NoSights is true, the weapon won't have ironsights
SWEP.NoSights = true
-- Equipment menu information is only needed on the client
if CLIENT then
-- Path to the icon material
SWEP.Icon = "VGUI/ttt/icon_decimator"
-- Text shown in the equip menu
SWEP.EquipMenuData = {
type = "Weapon",
desc = "A heavily modified TMP, with a 5 round burst to prevent it from over-heating. Quickly and silently dispose of the innocents, although a side effect of its awesome power is a high recoil."
};
end
-- Tell the server that it should download our icon to clients.
if SERVER then
-- It's important to give your icon a unique name. GMod does NOT check for
-- file differences, it only looks at the name. This means that if you have
-- an icon_ak47, and another server also has one, then players might see the
-- other server's dumb icon. Avoid this by using a unique name.
resource.AddFile("VGUI/ttt/icon_decimator.vmt")
end
If no one knows how to I'll just lower the damage and increase the time between shots and I guess it will be okay.