Some dumb coding stuff

Discussion in 'Tech Talk' started by The Hatter, Nov 21, 2013.

  1. The Hatter

    The Hatter Scarcely Active

    Joined:
    Nov 13, 2013
    Messages:
    7
    Ratings:
    +5 / 0
    So, I am the friend of Etcchi who knows a little lua. I can do up to and including the following.
    -Make Weapons from scratch
    -Edit current weapons
    -Edit most aspects of HUDs and such
    -Make, take, find icons for said weapons

    Code:
    SWEP.Base = "weapon_tttbase"
    SWEP.Kind = WEAPON_EQUIP1
    // WEAPON_PISTOL: pistol and the deagle.
    // WEAPON_HEAVY: rifles, shotguns, machineguns.
    // WEAPON_NADE: grenades.
    // WEAPON_EQUIP1: special equipment,usually bought with credits and Traitor/Detective-only.
    // WEAPON_EQUIP2: same as above, secondary equipment slot. You can carry one of each.
    // WEAPON_ROLE: special equipment that is default equipment for a role, like the DNA Scanner.
    // WEAPON_MELEE: only for the crowbar players get by default.
    // WEAPON_CARRY: only for the Magneto-stick, default equipment.
    SWEP.AmmoEnt = "item_ammo_type_ttt"
    // item_ammo_pistol_ttt: Pistol and M16 ammo.
    // item_ammo_smg1_ttt: SMG ammo, used by MAC10 and UMP.
    // item_ammo_revolver_ttt: Desert eagle ammo.
    // item_ammo_357_ttt: Sniper rifle ammo.
    // item_box_buckshot_ttt: Shotgun ammo.
    SWEP.Icon = "VGUI/ttt/icon_servername_weapontitle"
    if SERVER then
      resource.AddFile("materials/VGUI/ttt/icon_servername_weapontitle.vmt")
    end
    // Replace SERVER with unique server name
    SWEP.CanBuy = { ROLE_TRAITOR }
    // ROLE_TRAITOR
    // ROLE_DETECTIVE
    SWEP.InLoadoutFor = nil
    // Lets anyone use it
    SWEP.LimitedStock = false
    // For D or T, false means it can be bought multiple times and true means it can only be bought once
    SWEP.EquipMenuData = {
      type = "Weapon",
      desc = "Example custom weapon."
    };
    SWEP.AllowDrop = true
    SWEP.IsSilent = false
    // If the victim is killed they will make a noise if set to false, if true they will be silent
    SWEP.NoSights = false
    // true means no ironsights, false allows iron sights
    SWEP.AutoSpawnable = false
    // Only applies for non WEAPON_EQUIP items
    SWEP.WeaponID = ...
    // DO NOT SET IN CUSTOM WEAPONS
    SWEP.IronSightsPos = Vector(x, y, z)
    SWEP.IronSightsAng = Vector(x, y, z)
    // Deal with ironsights, I don't want to mess with this
    That's code for a very basic TTT weapon. I guess I commented stuff incorrectly. Lua is supposed to be -- I think.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Hacked Cupcake

    Hacked Cupcake Unwavering

    Joined:
    Nov 29, 2013
    Messages:
    77
    Ratings:
    +10 / 2
    Yeah, one of the only things I know about Lua is commenting is --
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  • About Harpoon

    Harpoon Gaming is a gaming community, with servers in Team Fortress 2, Minecraft, and more. We were founded on the idea that no matter who you are, you have a home here. Too often we see communities rife with bullies and trolls, and Harpoon was created because we think we can do better than that.
  • Like us on Facebook

  • Donate to Harpoon!

    Donator is 1 key per month and 16 keys for lifetime. You will have donator access on all of our servers. If you wish to donate to Harpoon Gaming, contact a Full Admin or above. To learn more, head over to the donator page.

    Donate to us!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice