net.Send() returning null in swep

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.

function SWEP:PrimaryAttack()

net.Send 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]


[editline]28th June 2016[/editline]

Prediction only calls it serverside in singleplayer

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]

Thanks. That’s why it screws up in MP.