I want a gun (or hands or whatever, guess the mdl determines that) that performs the same function.
For example I want a player to pick up a piece of rope and be able to use it like the rope tool but only once (like ammo in a gun).
Any help on this would be REALLY appreciated as it’s vital to what I want to do.
[editline]10:08PM[/editline]
Could this work for a nail gun swep for example?
function SWEP:PrimaryAttack()
local vStart = self.owner:GetShootPos()
local vForward = self.owner:GetAimVector()
local trace = {}
trace.start = vStart
trace.endpos = vStart + (vForward * 2048)
trace.filter = self.owner
local tr = util.TraceLine( trace )
if ( tr.HitWorld ) then return end
local tr2 = {}
tr2.start = tr.HitPos
tr2.endpos = trace.HitPos + (vforward * 2048)
tr2.filter = { self.owner, tr.Entity }
local trTwo = util.TraceLine( tr2 )
if ( trTwo.Hit && !trTwo.Entity:IsPlayer() ) then
local constraint, nail = MakeNail( trace.Entity, trTwo.Entity, trace.PhysicsBone, trTwo.PhysicsBone, 0, vstart, vforward )
end
end
end