• Self return nil when inside net function
    2 replies, posted
So because self won't work inside net functions, how do I call the entity I am in right now. This is a little bit of code from my init.lua [CODE]if (self:GetNWInt("stockstatus") == 0) and (self:GetNWInt("bodystatus") == 0) and (self:GetNWInt("barrelstatus") == 0) then net.Receive("gunbodyclick", function(len, ply) self:GetNWInt("bodystatus", 1) end) end[/CODE] Now, I already know that self won't work because it's not inside a function that can do this, but how could I make this work. Tell me if I'm being unclear about this.
I don't understand what you're trying to do? You're combining net library with automatically networked GetNWINt
[QUOTE=NiandraLades;50349076]I don't understand what you're trying to do? You're combining net library with automatically networked GetNWINt[/QUOTE] Oh crap. I am stupid. Lol for some reason, I created net functions even though I have already networked integers. Well, this is what I get for coding at midnight. :P
Sorry, you need to Log In to post a reply to this thread.