Issue with net.SendToServer in a SWEP.

I am using the following code.



function SWEP:PrimaryAttack()
net.Start("drawTesla")
net.WriteVector( Vector(1,1,1) )
net.WriteVector( Vector(10,10,10) )
net.SendToServer()
end

And I get this error.


[ERROR] gamemodes/terrortown/entities/weapons/poo.lua:79: attempt to call field 'SendToServer' (a nil value)
  1. unknown - gamemodes/terrortown/entities/weapons/poo.lua:79


You are trying to send to server from server.

Well, I tried to use net.Broadcast() in that same line but I get this then.



[ERROR] gamemodes/terrortown/entities/weapons/poo.lua:79: attempt to call field 'Broadcast' (a nil value)
  1. unknown - gamemodes/terrortown/entities/weapons/poo.lua:79


PrimaryAttack is called shared. You really shouldn’t need net messages.

oh god damn again I AM AN IDIOT >.< I CALLED A FUNCTION INSIDE OF A PRIMARY ATTACK FUNCTION AND THAT FUNCTION I CALLED IS ONLY CALLED BY CLIENT URGHH SORRY I am dumb.