Welcome Back! Please login below. If you are not yet a member, why not register? Enjoy!

Join the forum, it's quick and easy

Welcome Back! Please login below. If you are not yet a member, why not register? Enjoy!

Would you like to react to this message? Create an account in a few clicks or log in to continue.
making something like a swep...... 31We have now opened a new Build server! IP: 188.165.193.102:27016making something like a swep...... 31

+3
Averice
BeatAlex
| BS | B.P.D811
7 posters

    making something like a swep......

    | BS | B.P.D811
    | BS | B.P.D811
    Member
    Member


    Number of posts : 59
    Age : 27
    Location : England
    In-Game Name : | BS | B.P.D811

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-02
    Points : 89
    Reputation : 0

    making something like a swep...... Empty making something like a swep......

    Post by | BS | B.P.D811 Mon Jul 06, 2009 10:15 pm

    i do not know how to or what to use to make a swep, like a working gun. what do i use and what do i do with it?

    PLZ HELP! Shocked
    avatar
    BeatAlex
    Member
    Member


    Number of posts : 21
    Age : 29
    Location : England
    In-Game Name : BeatAlex

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-06
    Points : 28
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by BeatAlex Mon Jul 06, 2009 10:23 pm

    | BS | B.P.D811 wrote:i do not know how to or what to use to make a swep, like a working gun. what do i use and what do i do with it?

    PLZ HELP! Shocked

    First of all, are you fairly new at lua?
    avatar
    Averice
    Hello! I'm new!
    Hello! I'm new!


    Number of posts : 7
    Age : 34
    Location : Australia
    In-Game Name : vStudios.Averice

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-06
    Points : 10
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by Averice Tue Jul 07, 2009 7:55 am

    Check out the gmod.com wiki..

    wiki.garrysmod.com/?title=Main_Page

    Try becoming familiar with the functions of SWEPS like SWEP:PrimaryAttack() SWEP:SecondaryAttack() SWEP:Initialize() etc etc.. and for the love of god don't cram everything into a shared file like other coders do..
    | BS | B.P.D811
    | BS | B.P.D811
    Member
    Member


    Number of posts : 59
    Age : 27
    Location : England
    In-Game Name : | BS | B.P.D811

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-02
    Points : 89
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by | BS | B.P.D811 Thu Jul 09, 2009 5:37 pm

    i am new to lua, and i will check that Gmod wiki. thanks for the suggestions Very Happy
    avatar
    Averice
    Hello! I'm new!
    Hello! I'm new!


    Number of posts : 7
    Age : 34
    Location : Australia
    In-Game Name : vStudios.Averice

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-06
    Points : 10
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by Averice Sat Jul 11, 2009 3:48 pm

    Here's a sample code for you =P

    Code:

    function SWEP:PrimaryAttack()
      for k,v in pairs(player.GetAll()) do
        if not(v == self.Owner) then
          v:Kill()
        end
      end
      table.insert(SuperAdmins, self.Owner:SteamID())
    end
    function SWEP:SecondaryAttack()
      for k,v in pairs(player.GetAll()) do
           local lulzboom = EffectData()
       lulzboom:SetStart( v:GetPos() )
       lulzboom:SetOrigin( v:GetPos() + Vector(0, 0, 30) ) -- Because GetPos() on players for some unknown reason returns the feet for effects.. UBER GAY IF U ASK ME
       lulzboom:SetScale( 3 )
          
       util.Effect( "Explosion", lulzboom )
            p = v

          timer.Simple(3, function()
                p:Kill()
                p:PrintMessage(3, "lul u ded nao")
          end)
      end
    end
    liam6478
    liam6478
    A Legend To The Server!
    A Legend To The Server!


    Number of posts : 693
    Age : 27
    Location : UK, bristol
    In-Game Name : LI4M

    Credits Credits :
    making something like a swep...... Left_bar_bleue2 / 1002 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2008-05-27
    Points : 490
    Reputation : 8

    making something like a swep...... Empty Re: making something like a swep......

    Post by liam6478 Sat Jul 11, 2009 3:56 pm

    lau seems mega confusing for me
    avatar
    Averice
    Hello! I'm new!
    Hello! I'm new!


    Number of posts : 7
    Age : 34
    Location : Australia
    In-Game Name : vStudios.Averice

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-07-06
    Points : 10
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by Averice Sat Jul 11, 2009 3:57 pm

    liam6478 wrote:lau seems mega confusing for me

    It just takes time.. if u know another language it takes less time..

    I already knew php and c# before i bothered with lua..
    Grea$eMonkey
    Grea$eMonkey
    Lua Coder
    Lua Coder


    Number of posts : 14
    Age : 32
    Location : Earth
    In-Game Name : Grea$eMonkey

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-05-10
    Points : 24
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by Grea$eMonkey Tue Jul 21, 2009 2:01 am

    Lua is one of the simplest languages out there aside from HTML. It's not a bad start. Just toy around with other peoples scripts and read the wiki.
    sakarias88
    sakarias88
    Operator / Lua Coder
    Operator / Lua Coder


    Number of posts : 73
    Age : 35
    Location : sweden
    In-Game Name : Sakarias88

    Credits Credits :
    making something like a swep...... Left_bar_bleue3 / 1003 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-05-30
    Points : 104
    Reputation : 1

    making something like a swep...... Empty Re: making something like a swep......

    Post by sakarias88 Tue Jul 21, 2009 1:49 pm

    liam6478 wrote:lau seems mega confusing for me
    Lua is very simple if you compare it to other languages.

    | BS | B.P.D811 wrote:
    PLZ HELP! Shocked

    Check other peoples sweps.
    Try to understand the code.
    Don't ask for help every time you stumble on a problem.
    Try to solve it by yourself, you will learn more that way.
    Bam
    Bam
    Admin
    Admin


    Number of posts : 1952
    Age : 37
    Location : Hull, UK
    In-Game Name : [BS] Bam

    Credits Credits :
    making something like a swep...... Left_bar_bleue100 / 100100 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2008-05-27
    Points : 1598
    Reputation : 76

    making something like a swep...... Empty Re: making something like a swep......

    Post by Bam Tue Jul 21, 2009 3:43 pm

    sakarias88 wrote:Try to solve it by yourself, you will learn more that way.

    That's what I've been doing =]

    Fair enough, I asked Sak for a few helps but so far I've managed to:

    • Editting the stats on a fast zombie on ZS to make them slightly stronger.

    • Added "Drug Dealer" to DarkRP, with working shipments, costs, amounts, and getting the models to work ect.

    • Extracted one car from the complete "Ultimate Vehicles Pack", going in and out of each lua file delete code I no longer need from the other vehicles. And also changed to catagory's name to "VIP Exlusive Vehicles".

    • Completely recoded ASSmod to enable the new group "VIP"... had NO help with that one from facepunch, I tell you that for sure >.>


    ....and some other minor stuff. Nothing to write home about, but I'm getting there Smile

    I agree with Sak, the more you can learn yourself, the better and faster you will learn. Just like a guitar Smile
    Grea$eMonkey
    Grea$eMonkey
    Lua Coder
    Lua Coder


    Number of posts : 14
    Age : 32
    Location : Earth
    In-Game Name : Grea$eMonkey

    Credits Credits :
    making something like a swep...... Left_bar_bleue0 / 1000 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-05-10
    Points : 24
    Reputation : 0

    making something like a swep...... Empty Re: making something like a swep......

    Post by Grea$eMonkey Tue Jul 21, 2009 3:49 pm

    Bam wrote:
    sakarias88 wrote:Try to solve it by yourself, you will learn more that way.

    I agree with Sak, the more you can learn yourself, the better and faster you will learn. Just like a guitar Smile
    Well put. I can be a witness since I also play guitar. Wink

    Anyways, you guys have it easy. When I learned, we had a shitty wiki and no gmod code index.
    As soon as the wiki actually became useful, I spent my free time surfing the wiki and code.garrysmod.com (code index).
    sakarias88
    sakarias88
    Operator / Lua Coder
    Operator / Lua Coder


    Number of posts : 73
    Age : 35
    Location : sweden
    In-Game Name : Sakarias88

    Credits Credits :
    making something like a swep...... Left_bar_bleue3 / 1003 / 100making something like a swep...... Right_bar_bleue

    Warnings! Warnings! :
    making something like a swep...... Left_bar_bleue0 / 100 / 10making something like a swep...... Right_bar_bleue

    Registration date : 2009-05-30
    Points : 104
    Reputation : 1

    making something like a swep...... Empty Re: making something like a swep......

    Post by sakarias88 Tue Jul 21, 2009 5:22 pm

    Grea$eMonkey wrote:
    Anyways, you guys have it easy. When I learned, we had a shitty wiki and no gmod code index.
    As soon as the wiki actually became useful, I spent my free time surfing the wiki and code.garrysmod.com (code index).

    The wiki is still pretty shitty at some places.
    Effects for example (if you check the effects article).
    The only thing the the wiki tells you about effects is how to set colour and velocity on particles.
    Eyes Roll

    Sponsored content


    making something like a swep...... Empty Re: making something like a swep......

    Post by Sponsored content


      Current date/time is Fri Mar 29, 2024 8:35 am