• Nil value
    2 replies, posted
I'm getting attempt to call field "AddNetworkString" a nil value. My code is: [CODE] util.AddNetworkString("OnSpawn") util.AddNetworkString("RP Menu") function NameMenu( ply ) net.Start("OnSpawn") net.Send(ply) end hook.Add( "PlayerSpawn", "NameMenu", NameMenu ) net.Receive("Rp Menu",function(len, ply) ply:setRPName(TextEnt:GetValue()) end) [/CODE]
You need to run the code serverside, as [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/AddNetworkString]util.AddNetworkString[/url] is a serverside only file. You are getting the nil errors because it does not exist on the client.
[QUOTE=James xX;50302386]You need to run the code serverside, as [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/AddNetworkString]util.AddNetworkString[/url] is a serverside only file. You are getting the nil errors because it does not exist on the client.[/QUOTE] it's in a file called sv_RPname, so shouldn't that make it run serverside? [editline]11th May 2016[/editline] fixed it love u bb
Sorry, you need to Log In to post a reply to this thread.