TTT Weapon stucks in the air

Soo i made this script for my TTT Server, it works very well but if a player throws the weapon away it stucks in the air.
Hope someone can help me :wink:


if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	SWEP.HoldType			= "ar2"
	
end

if ( CLIENT ) then
	SWEP.PrintName			= "AW 50"	
	
	SWEP.Slot			    = 2
	SWEP.SlotPos			= 76
	SWEP.ViewModelFOV       = 70
	SWEP.IconLetter			= "b"
	SWEP.HoldType			= "ar2"

	
end
SWEP.HoldType				= "ar2"
SWEP.Base					= "weapon_tttbase"
SWEP.Kind					= WEAPON_HEAVY

SWEP.Spawnable				= true
SWEP.AdminSpawnable			= true
SWEP.AutoSpawnable			= true

SWEP.ViewModelFOV      		= 70
SWEP.ViewModel				= "models/weapons/v_aw50_awp.mdl"
SWEP.WorldModel				= "models/weapons/w_acc_int_aw50.mdl"
SWEP.MagModel 				= "models/weapons/unloaded/snip_awp_mag.mdl"
SWEP.ViewModelFlip			= true

SWEP.Weight					= 5
SWEP.AutoSwitchTo			= true
SWEP.AutoSwitchFrom			= true

SWEP.Secondary.Sound = Sound("Default.Zoom")
SWEP.Primary.Sound			= Sound("Weaponaw50.Single")
SWEP.Primary.Recoil			= 4.50
SWEP.Primary.Damage			= 90
SWEP.Primary.NumShots		= 1
SWEP.Primary.Cone			= 0.001
SWEP.Primary.ClipSize		= 7
SWEP.Primary.DefaultClip	= 7
SWEP.Primary.Delay			= 1.5
SWEP.Primary.Mode			= "semi"
SWEP.WeaponType				= "sniper"
SWEP.Primary.Ammo			= "357"
SWEP.AmmoEnt				= "item_ammo_357_ttt"
SWEP.AvailableFireMode    	= {"semi"}

SWEP.MuzzleEffect 			= "muzzle_lee_sniper"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo			= "none"

SWEP.IronSightsPos = Vector (-4.9899, 0, -4.0678)
SWEP.IronSightsAng = Vector (0, 0, 0)

SWEP.Offset = {
Pos = {
Up = 0,
Right = 1,
Forward = -3,
},
Ang = {
Up = 0,
Right = 0,
Forward = 0,
}
}

function SWEP:DrawWorldModel( )
local hand, offset, rotate

if not IsValid( self.Owner ) then
self:DrawModel( )
return
end

if not self.Hand then
self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" )
end

hand = self.Owner:GetAttachment( self.Hand )

if not hand then
self:DrawModel( )
return
end

offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up

hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right )
hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward )
hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up )

self:SetRenderOrigin( hand.Pos + offset )
self:SetRenderAngles( hand.Ang )

self:DrawModel( )
end

function SWEP:SetZoom(state)
    if CLIENT then 
       return
    elseif IsValid(self.Owner) and self.Owner:IsPlayer() then
       if state then
          self.Owner:SetFOV(20, 0.3)
       else
          self.Owner:SetFOV(0, 0.2)
       end
    end
end

-- Add some zoom to ironsights for this gun
function SWEP:SecondaryAttack()
    if not self.IronSightsPos then return end
    if self.Weapon:GetNextSecondaryFire() > CurTime() then return end
    
    bIronsights = not self:GetIronsights()
    
    self:SetIronsights( bIronsights )
    
    if SERVER then
        self:SetZoom(bIronsights)
     else
        self:EmitSound(self.Secondary.Sound)
    end
    
    self.Weapon:SetNextSecondaryFire( CurTime() + 0.4)
end

function SWEP:PreDrop()
    self:SetZoom(false)
    self:SetIronsights(false)
    return self.BaseClass.PreDrop(self)
end

function SWEP:Reload()
    self.Weapon:DefaultReload( ACT_VM_RELOAD );
    self:SetIronsights( false )
    self:SetZoom(false)
end


function SWEP:Holster()
    self:SetIronsights(false)
    self:SetZoom(false)
    return true
end

if CLIENT then
   local scope = surface.GetTextureID("sprites/scope")
   function SWEP:DrawHUD()
      if self:GetIronsights() then
         surface.SetDrawColor( 0, 0, 0, 255 )
         
         local x = ScrW() / 2.0
         local y = ScrH() / 2.0
         local scope_size = ScrH()

         -- crosshair
         local gap = 80
         local length = scope_size
         surface.DrawLine( x - length, y, x - gap, y )
         surface.DrawLine( x + length, y, x + gap, y )
         surface.DrawLine( x, y - length, x, y - gap )
         surface.DrawLine( x, y + length, x, y + gap )

         gap = 0
         length = 50
         surface.DrawLine( x - length, y, x - gap, y )
         surface.DrawLine( x + length, y, x + gap, y )
         surface.DrawLine( x, y - length, x, y - gap )
         surface.DrawLine( x, y + length, x, y + gap )


         -- cover edges
         local sh = scope_size / 2
         local w = (x - sh) + 2
         surface.DrawRect(0, 0, w, scope_size)
         surface.DrawRect(x + sh - 2, 0, w, scope_size)

         surface.SetDrawColor(255, 0, 0, 255)
         surface.DrawLine(x, y, x + 1, y + 1)

         -- scope
         surface.SetTexture(scope)
         surface.SetDrawColor(255, 255, 255, 255)

         surface.DrawTexturedRectRotated(x, y, scope_size, scope_size, 0)

      else
         return self.BaseClass.DrawHUD(self)
      end
   end

   function SWEP:AdjustMouseSensitivity()
      return (self:GetIronsights() and 0.2) or nil
   end
end

Make sure that model has physics and is installed correctly server side.

CSS isn’t mounted. Ask your hosting company(if you use a hosting company) to fix it or tell you how to fix it.

But…it’s TTT? It doesn’t need CSS mounted…it’s the gun physics files are missing.

I seriously have to question your logic…

You disagree with me then repeat what I just said.

Do you have any knowledge in hosting dedicated servers of course both suggestions are valid mounting CS:S has to be done eventually half the TTT maps use CS:S models so unless you want people to be able to walk through entities then you have to mount it. Yes it is true that Garry’s mod ships with the default gun models that include the physics files but even some of the basic things in TTT need CS:S for example the health station requires CS:S to be mounted otherwise it will be suspended in air as a no collide prop.

Learn more and stop being a post whore please.

Jeez bluebull107, everywhere you go you create some sort of drama.

As everyone is stating here you need to have the models on the server. If I’m thinking of the same AW 50 in the M9K packs you may want to upload those files to the server. Not the subscribed addon. Just extract and upload it.

Edit: I didn’t mean to sound hostile to bluebull. I’ll reword that.
“Jeez bluebull107, everywhere you go there is some sort of drama.”

Its not Bluebull’s fault, King Traitor is an ass. http://forum.facepunch.com/showthread.php?t=1422983&p=45921893&viewfull=1#post45921893

But uh, either your model is from CS:S and you didnt fix the bones to port it over or your physics file is missing. If its the former then you better get familiar with 3DS Max.

He didn’t cause anything, you’re just assuming that he was being hostile.

Also: