Unknown Command

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:

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?

Does the server have scriptenforcer on?

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”.


Is that right?

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

-snip Derpin here, dont mind me-

I phrased that wrong, I’m just trying to get a BHOP script to work on any server I go on.