TTT body disappears

#close

If the swep doesn’t already have a base, set SWEP.Base = “weapon_tttbase”

But it has a SWEP Base ._.

Look for lua errors in your console.

Yeah ive got this Error :



[ERROR] gamemodes/terrortown/gamemode/player.lua:600: attempt to call method 'DampenDrop' (a nil value)
  1. unknown - gamemodes/terrortown/gamemode/player.lua:600


Edit:
And this :




[ERROR] gamemodes/terrortown/gamemode/player.lua:600: attempt to call method 'DampenDrop' (a nil value)
  1. unknown - gamemodes/terrortown/gamemode/player.lua:600
   2. DispatchTraceAttack - [C]:-1
    3. DoAttack - lua/weapons/csgo_baseknife.lua:201
     4. unknown - lua/weapons/csgo_baseknife.lua:140



Put this somewhere on your weapon script:



function SWEP:DampenDrop()
   local phys = self:GetPhysicsObject()
   if IsValid(phys) then
      phys:SetVelocityInstantaneous(Vector(0,0,-75) + phys:GetVelocity() * 0.001)
      phys:AddAngleVelocity(phys:GetAngleVelocity() * -0.99)
   end
end


@Stardust342
Thx I think it helps :slight_smile: