attempt to call field 'AddNetworkString' (a nil value)
3 replies, posted
Hello, sorry for my bad english, i'm French :p
First, clientside hooks StartChat. After that, the function PlayerStartChat precache, prepare and transfer the name of the player (ply) to the server. After that, the server do that he would do.
Or, to fix that, if you know another way for the server get the name of the player who have oppened his chat... ^^
The error is on the line : util.AddNetworkString( "PlayerName" )
Can you help me please ? ^^
[CODE]net.Receive( "PlayerName", function( len, client )
ply = ""
local ply = net.ReadString()
-- The serverside script part, we don't this part for my problem.
end
end )
local function PlayerStartChat(boolean)
local ply = LocalPlayer()
util.AddNetworkString( "PlayerName" )
net.Start( "PlayerName" )
net.WriteString( ply )
net.SendToServer()
end
hook.Add( "StartChat", "PlayerOpennedTheirChat", PlayerStartChat)[/CODE]
util.AddNetworkString is serverside you are calling it clientside
in my experience - you can't teach logical thinking. Either someone's got it, or they don't.
[url]http://blog.codinghorror.com/why-cant-programmers-program/[/url]
Sorry, you need to Log In to post a reply to this thread.