Net message sending nil value instead of actual string/integer
0 replies, posted
So I am making a leveling system and basically whenever I try to send the players info from the server to client using net.WriteString or net.WriteInt on the client the value is always nil.
Please someone help me fix this maybe i've made a silly mistake I haven't noticed.. I have tried to fix but I can't figure it out :/
ClientSide (whenever I call this and set a variable equal to it, the variable is nil this is the problem):
function getclientlvl()
net.Start("GetLVLClient")
net.SendToServer()
net.Receive("GiveLVLClient", function()
local LVL = net.ReadString()
end)
return LVL
end
ServerSide (the GetEXPandLVL function definitely returns the right value as I printed it on server console):
net.Receive("GetLVLClient", function(len, ply)
local STEAMID64 = tostring(ply:SteamID64())
net.Start("GiveLVLClient")
net.WriteString( GetEXPandLVL( STEAMID64,lvl,k ) )
net.Send( ply )
end)
Sorry, you need to Log In to post a reply to this thread.