attempt to call upvalue 'ply' (a userdata value)


function OpenTest(ply)
	timer.Create("TestTimer", 10, 1, function()
		if not ply():CheckGroup("donator") then
			net.Start('openthetest')
			net.Send(ply)
		end
	end)
end

returns the error


[ERROR] addons/test/lua/autorun/server/sv_test.lua:3: attempt to call upvalue 'ply' (a userdata value)
  1. unknown - addons/test/lua/autorun/server/sv_test.lua:3

Timer Failed! [TestTimer][@addons/test/lua/autorun/server/sv_test.lua (line 2)]

ply isn’t a function.

What do I need to change to fix this? Thanks

Third line in the code you provided. ‘ply’ isn’t a function and you’re trying to call it.


function OpenTest(ply)
	timer.Create("TestTimer", 10, 1, function()
		if not ply:CheckGroup("donator") then
			net.Start('openthetest')
			net.Send(ply)
		end
	end)
end

thanks