I try to network a table with some information over but I need to use the player object that I send it to but it doesn't find it and its a nil value.
Clientside:
[lua]
net.Receive( "sendKillerInformation", function(length, ply)
print("got it")
local Table = net.ReadTable()
ply:SetNWString("killer", "fuk")
end)
[/lua]
Serverside:
[lua]
hook.Add("PlayerDeath", "killerInformation", function(ply,inf,ent)
local kill_info = {}
if ent:IsPlayer() then
kill_info.killer = ent:Nick()
kill_info.inf = inf
else
kill_info.killer = ent:GetClass()
kill_info.inf = "N/A"
end
net.Start("sendKillerInformation")
net.WriteTable(kill_info)
net.Send(ply)
end)
[/lua]
Error:
[lua]
[ERROR] gamemodes/operationstrike/gamemode/modules/vgui/cl_hud.lua:191: attempt to index local 'ply' (a nil value)
1. func - gamemodes/operationstrike/gamemode/modules/vgui/cl_hud.lua:191
2. unknown - lua/includes/modules/net.lua:30
[/lua]
you have to set the networked string serverside, plus that doesn't work because clientside, the ply argument is nil
Well Acecool is my hero.
Sorry, you need to Log In to post a reply to this thread.