attempt to index local 'object' (a function value)

Hello, I am getting this error and don’t know how to fix it.


[ERROR] lua/includes/util.lua:181: attempt to index local 'object' (a function value)
  1. IsValid - lua/includes/util.lua:181
   2. WriteEntity - lua/includes/extensions/net.lua:52
    3. OnRun 
     4. func 
      5. unknown - lua/includes/extensions/net.lua:32

Code: (:snip: due to job)


	OnRun = function(Player, Trace)
		util.AddNetworkString("test")
		util.AddNetworkString("test2")
		net.Start("test")
		net.Send(Player)
		net.WriteEntity(ply)
		net.Receive("test2", function(len, ply)
		local minutes = net.ReadInt(8)
		end)
	
	end

It’s probably because you’re using ply instead of Player for the net.WriteEntity. Furthermore you probably want the net.Send and net.WriteEntity the other way around

Thanks, commenting that out since I don’t use it anyway fixed it!