• net.Send() returning null in swep
    3 replies, posted
no clue why this isnt working. returns an error saying "attempt to call field Send (a null value)" here is the code in the weapon. [CODE]function SWEP:PrimaryAttack() net.Start("StartBRequest") net.Send(self.Owner) end [/CODE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] is a serverside function (also, what's the point of sending a net message to the weapon's owner? You could just run a SWEP function)
Make sure you're only running that serverside. [editline]28th June 2016[/editline] Ninja'd [editline]28th June 2016[/editline] [QUOTE=MPan1;50608978][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] is a serverside function (also, what's the point of sending a net message to the weapon's owner? You could just run a SWEP function)[/QUOTE] Prediction only calls it serverside in singleplayer
[QUOTE=MPan1;50608978][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] is a serverside function (also, what's the point of sending a net message to the weapon's owner? You could just run a SWEP function)[/QUOTE] The reason I'm trying to toss a netmessage to the owner is because it's a nutscript plugin. I have it to where it sends it to the player, the player sends it to the server, and the server checks out if the request is valid, if so, it tosses it back to the player with the required info. I don't know if I can access the NS plugin directly from the weapon file; I was going to test it afterwards and adjust it shortly, since this is only for debug atm. You are probably right, I can use plugin functions and check it on the weapon, and it's all redundant. I'll sort it out eventually. [editline]28th June 2016[/editline] [QUOTE=code_gs;50608981]Make sure you're only running that serverside. [editline]28th June 2016[/editline] Ninja'd [editline]28th June 2016[/editline] Prediction only calls it serverside in singleplayer[/QUOTE] Thanks. That's why it screws up in MP.
Sorry, you need to Log In to post a reply to this thread.