Getting lua error while using FindMetaTable("Player")
2 replies, posted
So i'm trying make a name changer menu and when i try to get the players name on the server using FindMetaTable("Player") like this:
local meta = FindMetaTable("Player")
function meta:Setthenames( len, pl )
local ply = net.ReadEntity()
self.SetDarkRPVar("rpname", "plswork")
end
net.Receive( "Setplyrpname", meta.Setthenames)
it gives me the lua error: attempt to index local 'self' (a number value)
And when printing "self" it prints 64 in console.
When you define a function like that it's actually doing
function meta.Setthenames(self, len, pl)
And as seen on the net.Receive wiki page, the arguments passed to the callback are the length of the message then the player. It doesn't match the calling method of meta functions.
Thanks so much for the help!
Sorry, you need to Log In to post a reply to this thread.