Garry's Mod

Garry's Mod

508 ratings
TTT M60
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Realism
File Size
Posted
Updated
6.834 MB
5 Apr, 2015 @ 11:33pm
10 Jul, 2015 @ 3:24pm
5 Change Notes ( view )

Subscribe to download
TTT M60

Description
A weapon for the Garry's Mod addon Trouble in Terrorist Town (TTT)

This weapon was designed for Innocent's use.

Weapon Stats:
200 round box
14.5 damage per body shot
0.1275 delay between firing

Note: I did not make the weapon model and do not take credit for it. I will remove this if the creator wants me to.
15 Comments
Dorito 22 Oct, 2016 @ 9:05pm 
Can I Use This Outside Of TTT?
*Sam 11 Jul, 2015 @ 4:56pm 
Here you are, this is exactly as I'm using it on my server and I don't get any lua script errors.
http://pastebin.com/YiYaUWm1
There are a couple other changes in there too, just a heads up.
FrostyIce  [author] 11 Jul, 2015 @ 3:05am 
I'll have to look more in depth into your code when I have time. So far, when I put your changes in, the game has a draw error. If you want to just put the entire shared.lua file up on pastebin, it'll alleviate any errors that you may have when pasting. But, as of right now, I get the following when running it.

[ERROR] addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:220: attempt to call method 'SetRenderOrigin' (a nil value)
1. DrawWorldModel - addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:220
2. unknown - addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:180

Thanks for the attempt, anyways. Glad to see someone take an interest in it.
*Sam 10 Jul, 2015 @ 5:27pm 
And in the SWEP:DrawWorldModel code, change the if not IsValid(self.owner) part to:

if not IsValid( self.Owner ) then
self:SetRenderOrigin(self.Pos)
self:SetRenderAngles(self.Ang)
self:DrawModel( )
return
end

and the if not hand part to:
if not hand then
self:SetRenderOrigin(self.Pos)
self:SetRenderAngles(self.Ang)
self:DrawModel( )
return
end
*Sam 10 Jul, 2015 @ 5:25pm 
After experimenting a bit more, I think I found a better fix that should eliminate the problem all together. It seems as though for some reason the game will sometimes not draw the weapon immediately after drop, so you have to force it to draw. The CalcAbsolutePosition code keeps track of where the weapon ACTUALLY is in the world.
You may want to check and confirm that this code is working though, I may have missed something when copying it into here:

SWEP.Pos = nil
SWEP.Ang = nil

function SWEP:CalcAbsolutePosition(pos, ang)
self.Pos = pos
self.Ang = ang
return
end

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

function SWEP:Think()
self:DrawWorldModel( )
end

function SWEP:RenderOverride()
self:DrawWorldModel()
end

function SWEP:OnDrop()
self.Owner = nil
end
FrostyIce  [author] 10 Jul, 2015 @ 3:26pm 
Alright, the gma has been updated. Thanks for the help. If you don't mind, I gave you credit in the change notes for the new code.
*Sam 9 Jul, 2015 @ 9:09pm 
So I was having a play around with this and I think I partially solved the problem with the world model being drawn stationary in the air after drop.

Inside the SWEP:DrawWorldModel() code, remove the first clause:

if not IsValid( self.Owner ) then return end

and replace it with:

if not IsValid( self.Owner ) then
self:SetRenderOrigin(self:GetNetworkOrigin())
self:SetRenderAngles(self:GetNetworkAngles())
self:DrawModel( )
return
end

This KIND OF fixes the problem, the gun will sometimes still be invisible initially but will become visible in the correct location after a time.
FrostyIce  [author] 28 Apr, 2015 @ 12:54pm 
LMG/HMG is just an abbreviated way of saying Light Machine Gun/Heavy Machine Gun, which is what the M60 is.
DH1806 28 Apr, 2015 @ 5:04am 
Well I'll do it if you tell me what LMGs/HMGs is :D
FrostyIce  [author] 27 Apr, 2015 @ 2:09pm 
It usually occurs with the LMGs/HMGs, if you look at any of them, they will most likely occur. If you know of one that doesn't have this issue, link it, and I'll see how they calculate the dropped weapon's physics.