Need a little lua help I think it's an outdated issue (swep)

[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_poisondart/shared.lua:123: attempt to call global ‘SinglePlayer’ (a nil value)

  1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_poisondart/shared.lua:123

Lines 122-128

if ( (SinglePlayer() and SERVER) or CLIENT ) then
self.Weapon:SetNetworkedFloat( “LastShootTime”, CurTime() )
end

end

Could someone help me fix this and maybe explain it?
I tried getting rid of the singleplayer part but it didn’t work

update: I fixed that error it was rather simple, didn’t need singleplay or server just client.

Here’s what i need help with now

The gun in the game is held on the left side, the animation still comes off the right, how do I make it held on the right side?


if SERVER then
   AddCSLuaFile( "shared.lua" )
   resource.AddFile( "materials/vgui/ttt/icon_poison_dart.vmt" )
end


SWEP.HoldType			= "crossbow"


if CLIENT then
   SWEP.PrintName			= "Poison Dart"
   SWEP.Author				= "TTT"
   SWEP.Slot				= 7
   SWEP.SlotPos			= 0


   SWEP.EquipMenuData = {
      type="Weapon",
      model="models/weapons/w_crossbow.mdl",
      desc="Shoot someone to poison him."
   };


   SWEP.Icon = "materials/vgui/ttt/icon_poisondart"
end


SWEP.Base = "weapon_tttbase"
SWEP.Primary.Recoil	= 1
SWEP.Primary.Damage = 1
SWEP.Primary.Delay = 120
SWEP.Primary.Cone = 0.0
SWEP.Primary.ClipSize = 1
SWEP.Primary.Automatic = true
SWEP.Primary.DefaultClip = 3
SWEP.Primary.ClipMax = 1
SWEP.Primary.Ammo = "none"
SWEP.ViewModelFOV		= 54


SWEP.Kind = WEAPON_HEAVY
SWEP.CanBuy = {ROLE_TRAITOR} -- only traitors can buy


SWEP.AmmoEnt = "item_ammo_357_ttt"


SWEP.IsSilent = true
SWEP.LimitedStock = true


SWEP.ViewModel			= "models/weapons/v_crossbow.mdl"
SWEP.WorldModel			= "models/weapons/w_crossbow.mdl"


SWEP.Primary.Sound = Sound( "Weapon_Crossbow.Single" )
SWEP.IronSightsPos = Vector( 4.48, -4.34, 2.75)
SWEP.IronSightsAng = Vector(-0.5, 0, 0)


SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK_SILENCED
SWEP.ReloadAnim = ACT_VM_RELOAD_SILENCED


function SWEP:Deploy()
   self.Weapon:SendWeaponAnim(ACT_VM_DRAW_SILENCED)
   return true
end


--[[-- We were bought as special equipment, and we have an extra to give
function SWEP:WasBought(buyer)
   if IsValid(buyer) then -- probably already self.Owner
      buyer:GiveAmmo( 16, "Pistol" )
   end
end]]
function SWEP:PrimaryAttack(worldsnd)


   self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
   self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )


   if not self:CanPrimaryAttack() then return end
   
   if not worldsnd then
      self.Weapon:EmitSound( self.Primary.Sound )
   else
      WorldSound(self.Primary.Sound, self:GetPos())
   end




   self:ShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.Primary.Cone, self.Doors, self.Force, self.TracerName )
   if SERVER then
   if self.Owner:GetEyeTrace().HitNonWorld and self.Owner:GetEyeTrace().Entity:IsPlayer() then
 
   local en = self.Owner:GetEyeTrace().Entity
   local uni = en:UniqueID()
   en:EmitSound("ambient/voices/citizen_beaten" .. math.random(1,5) .. ".wav",500,100)
   timer.Create(en:UniqueID() .. "poisondart", 1, 0, function()
   
   if IsValid(en) and en:IsTerror() then
   if IsValid(self.Owner) then
   en:TakeDamage(1,self.Weapon,self.Owner)
   else
      en:TakeDamage(1,self.Weapon,self.Weapon)
   end
else
timer.Destroy(uni .. "poisondart")
end
   end)
   
   end
   end
   self:TakePrimaryAmmo( 1 )
   
   if not IsValid(self.Owner) or self.Owner:IsNPC() or (not self.Owner.ViewPunch) then return end
   
   self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) )
   
   if  CLIENT  then
      self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
   end


end

[editline]8th September 2013[/editline]

Solution:

add this in
SWEP.ViewModelFlip = false