Welcome, Guest. Please login or register.
Did you miss your activation email?
September 19, 2024, 11:48:31 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Golden Gun Not Working
Pages: [1]
Author Topic: Golden Gun Not Working  (Read 3803 times)
M4RK
Poster

Posts: 12


« on: July 05, 2011, 07:45:56 PM »

My Golden Gun is not working? Any help D:


---- Example TTT custom weapon

-- First some standard GMod stuff
if SERVER then
  AddCSLuaFile( "shared.lua" )
end

if CLIENT then
  SWEP.PrintName = "Golden Gun"
  SWEP.Slot      = 1 -- 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.08
SWEP.Primary.Recoil      = 1.9
SWEP.Primary.Automatic   = false
SWEP.Primary.Damage      = 500
SWEP.Primary.Cone        = 0.025
SWEP.Primary.Ammo        = ""
SWEP.Primary.ClipSize    = 1
SWEP.Primary.ClipMax     = 1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Sound = Sound( "Weapon_Deagle.Single" )

SWEP.ViewModel  = "models/weapons/v_pist_geagle.mdl"
SWEP.WorldModel = "models/weapons/w_pist_geagle.mdl"

function GoldenGun()
if ply:IsTraitor() then ply:TakeDamage()

end


--- 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, EQUIP1, EQUIP2 or ROLE.
-- Matching SWEP.Slot values: 0      1       2     3      4      6       7        8
SWEP.Kind = WEAPON_PISTOL

-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can
-- be spawned as a random weapon. Of course this AK is special equipment so it won't,
-- but for the sake of example this is explicitly set to false anyway.
SWEP.AutoSpawnable = false

-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
SWEP.AmmoEnt = ""

-- 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_DETECTIVE }

-- 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 = true

-- If AllowDrop is false, players can't manually drop the gun with Q
SWEP.AllowDrop = false

-- If IsSilent is true, victims will not scream upon death.
SWEP.IsSilent = false

-- 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_st_goldengun"

  -- Text shown in the equip menu
  SWEP.EquipMenuData = {
     type = "Weapon",
     desc = "One shot. Kills."
  };
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("materials/VGUI/ttt/icon_st_goldengun.vmt")
  resource.AddFile("models/weapons/v_st_geagle.dx80.vtx")
  resource.AddFile("models/weapons/v_st_geagle.dx90.vtx")
  resource.AddFile("models/weapons/v_st_geagle.mdl")
  resource.AddFile("models/weapons/v_st_geagle.sw.vtx")
  resource.AddFile("models/weapons/v_st_geagle.vvd")
end

Smexy
Poster

Posts: 27

PM Me for Girl Support :P


« Reply #1 on: July 05, 2011, 09:02:06 PM »

From what I remember you dont need the resource.AddFile It has caused problems before (DONT DELETE IT YET)

Ask Sniperduck

Yes, Im a girl.
Got a problem with that?
                                          There are two medicines 1. Talk to my fist in your mouth 2. Go see a god damn anal doctor.

Amen
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Golden Gun Not Working « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.007 seconds with 17 queries.