Attempt to call field 'AddNetworkString' (a nil value)

In theory this should work. I can’t spot any mistakes?


    util.AddNetworkString("PoliceArmoury")
    net.Receive( "PoliceArmoury", function( length, client )
        if( net.ReadString() == "ARMEDP" )then
            ArmedPolice()
        elseif( net.ReadString() == "POLICE" ) then
            Police()
        elseif( net.ReadString() == "POLICECHIEF" ) then
            PoliceChief()
        elseif( net.ReadString() == "PMGUARD" ) then
            PMGUARD()
        elseif( net.ReadString() == "PM" ) then
            PM()
        end
    end )

I can.


    util.AddNetworkString("PoliceArmoury")
    net.Receive( "PoliceArmoury", function( length, client )
        local a = net.ReadString() 
        if( a == "ARMEDP" )then
            ArmedPolice()
        elseif(a == "POLICE" ) then
            Police()
        elseif( a == "POLICECHIEF" ) then
            PoliceChief()
        elseif(a == "PMGUARD" ) then
            PMGUARD()
        elseif( a == "PM" ) then
            PM()
        end
    end )

You are trying to read string after string while you send only one string ( Assuming ).

AddNetworkString is serverside, not clientside.