1. Post #1

    January 2012
    4 Posts
    I am a complete stupid noob and I don't know shit all about what to do.
    That's why I'm asking here.
    I'm trying to get a BHop script onto a server,
    So I made a text document and put the following into it:
    Code:
    local function BHop(ucmd) //Begin declaring a function
        if not(ShouldBHop:GetInt() == 0) then //If we're supposed to bhop
            if LocalPlayer():OnGround() then //And we're on the ground
                ucmd:SetButtons( ucmd:GetButtons() | IN_JUMP ) //Then add IN_JUMP to our current keys.
            end //End if
        end //End if
    end //End function
    hook.Add("CreateMove" , "BHop", BHop) //Hook the function to "CreateMove"
    ShouldBHop = CreateClientConVar("bunnyhop", 0, true, false) //Create a client convar
    concommand.Add("+bunnyhop" , function() //Make a new console command, +bunnyhop
        RunConsoleCommand("bunnyhop" , 1)
    end )
     
    concommand.Add("-bunnyhop" , function() //Make a new console command, -bunnyhop
        RunConsoleCommand("bunnyhop" , 0)
    end )
    I saved it as "Bunnyhop.lua"
    And put it in garrysmod/lua/autorun/client

    I then went into the server and I binded the key by going
    bind space +bunnyhop

    I press the key and I get this:

    Unknown Command: '+bunnyhop'
    Unknown Command: '-bunnyhop'

    What am I doing wrong?

  2. Post #2
    wizardsbane's Avatar
    January 2008
    372 Posts
    Does the server have scriptenforcer on?

    Edit:
    Also, I trust you're putting this in the right directory? LocalPlayer() and associated clientside libraries cannot be accessed outside of the client. I'm just worried because you've said you're putting it "onto a server".

  3. Post #3

    January 2012
    4 Posts
    Does the server have scriptenforcer on?

    Edit:
    Also, I trust you're putting this in the right directory? LocalPlayer() and associated clientside libraries cannot be accessed outside of the client. I'm just worried because you've said you're putting it "onto a server".
    garrysmod/lua/autorun/client

    Is that right?

  4. Post #4
    wishbone's Avatar
    October 2008
    353 Posts
    You can't put a client file on the server. I don't think it will work. It has to go in the client's file. Otherwise that file path is correct
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  5. Post #5
    Best Gamemode Ever
    Deadman123's Avatar
    July 2011
    1,085 Posts
    -snip Derpin here, dont mind me-
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 1 (list)

  6. Post #6

    January 2012
    4 Posts
    I'm just worried because you've said you're putting it "onto a server".
    I phrased that wrong, I'm just trying to get a BHOP script to work on any server I go on.