Why my effects work in singleplayer but not in multiplayer?

**Objective: **I’m trying to get my effects appear in multiplayer. They work perfectly fine on singleplayer but in multiplayer, I can’t even see my bullets or bullet holes.
**Error: **Effects don’t appear in multiplayer at all.
**Code: ** [lua]

function SWEP:PrimaryAttack()

if (self.Weapon:CanPrimaryAttack() != true) then return end

self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
self.Weapon:EmitSound( ShootSound )
self.Weapon:SetNextPrimaryFire( CurTime() + GetConVarNumber(tostring("frugle_smgreload")))

bullet = {}
bullet.Src		= self.Owner:GetShootPos()
bullet.Attacker = self.Owner
bullet.Dir		= self.Owner:GetAimVector()
bullet.Spread		= Vector(0.03,0.03,0.03)
bullet.Num		= 1
bullet.Damage		= math.random(2,5)
bullet.Force		= 3
bullet.Tracer		= 1	
bullet.TracerName	= "Tracer"
bullet.Callback	= function( attacker, tr, dmginfo )

						local tr = self.Owner:GetEyeTrace()
						local effectdata = EffectData()
						effectdata:SetOrigin( tr.HitPos )
						effectdata:SetScale( 1 )
						effectdata:SetNormal( tr.HitNormal )
						effectdata:SetMagnitude( 4 )
						effectdata:SetRadius( 8 )

						util.Effect("cball_bounce", effectdata)
if (!SERVER) then return end

self.Owner:FireBullets( bullet )


**Notes: **Help is greatly appreciated

I’ve tried to do it like it’s done on manhack gun but it still doesn’t work :frowning:

Automerge didn’t work…

Anyway here two screenshots if that helps.





You need to put

[lua]if (!SERVER) then return end[/lua]


[lua]self.Owner:FireBullets( bullet )[/lua]

Calling FireBullets on the client is what allows it to render the tracers and other clientside effects related to the bullets.

Thanks but that didn’t work :frowning:

Did you remove line 36 and put it below it instead of making 2?

Of course I removed it.


and put it below

EDIT: I finally got it working!

I changed
[lua]if (self.Weapon:CanPrimaryAttack() != true) then return end[/lua]

[lua]if (self.Weapon:CanPrimaryAttack() == false) then return end[/lua]

No idea why it started working after that.