Sucker - Opposite of Forcer

Is it possible to have a tool that pulls things in? But have it working like a forcer with the changable beam length? Because one of my friends gave me a great idea! He always thinks up funny things to do… you can probably think what it is by looking at the Thread Name

If you’re using wiremod you already have the grabber. Also have you tried simply using a negative value for the forcer?

hmmmmmm i was thinking about that but i never had tome to go on gmod tonight, but that grabber GRABS things doesn’t it? Or can you get it to pull things?

Last time I used wire you could put a negative force in for the forcer.

Negative value never worked for me. :-/ That would be pretty cool though.

Field generator has this ability

Last time i used wire, i figured out it used up 1.2 GB of memory and about 1 GB of ram… So i uninstalled it.


(User was banned for this post ("Why reply?" - mahalis))

yes but i need it to be able to suck things from a distance, like how the forcer works…but opposite

gmod_toolmode leafblower

Memory and ram? Uh.

very funny, i need something that attaches to stuff, not just changing my toolgun into a leafblower.

and did u eaven read? i need something that SUCKS not BLOWS

[lua]

TOOL.AddToMenu = false

//
// This tool is the most important aspect of Garry’s Mod
//

TOOL.LeftClickAutomatic = true

function TOOL:LeftClick( trace )

if ( CLIENT ) then return end

util.PrecacheSound( "ambient/wind/wind_hit2.wav" )
self:GetOwner():EmitSound( "ambient/wind/wind_hit2.wav" )

if ( trace.Entity:IsValid() ) then

	if ( trace.Entity:GetPhysicsObject():IsValid() ) then
	
		local phys = trace.Entity:GetPhysicsObject()		// The physics object
		local direction = trace.StartPos - trace.HitPos		// The direction of the force
		local force = 32					// The ideal amount of force
		local distance = direction:Length()			// The distance the phys object is from the gun
		local maxdistance = 512					// The max distance the gun should reach
		
		// Lessen the force from a distance
		local ratio = math.Clamp( (1 - (distance/maxdistance)), 0, 1 )
		
		// Set up the 'real' force and the offset of the force
		local vForce = -1*direction * (force * ratio)
		local vOffset = trace.HitPos
		
		// Apply it!
		phys:ApplyForceOffset( vForce, vOffset )
					
	end
	
end

end[/lua]

That looks like the leafblower, right?

Change it so as it uses the negative of the distance

[lua]

TOOL.AddToMenu = false

//
// This tool is the most important aspect of Garry’s Mod
//

TOOL.LeftClickAutomatic = true

function TOOL:LeftClick( trace )

if ( CLIENT ) then return end

util.PrecacheSound( "ambient/wind/wind_hit2.wav" )
self:GetOwner():EmitSound( "ambient/wind/wind_hit2.wav" )

if ( trace.Entity:IsValid() ) then

	if ( trace.Entity:GetPhysicsObject():IsValid() ) then
	
		local phys = trace.Entity:GetPhysicsObject()		// The physics object
		local direction = trace.StartPos - trace.HitPos		// The direction of the force
		local force = 32					// The ideal amount of force
		local distance = direction:Length()			// The distance the phys object is from the gun
		local maxdistance = 512					// The max distance the gun should reach
		
		// Lessen the force from a distance
		local ratio = math.Clamp( (1 - (distance/maxdistance)), 0, 1 )
		
		// Set up the 'real' force and the offset of the force
		local vForce = -1* - direction * (force * ratio)
		local vOffset = trace.HitPos
		
		// Apply it!
		phys:ApplyForceOffset( vForce, vOffset )
					
	end
	
end

end
[/lua]

Guess what it does now? :eng101:

wow…clever… never thought of that… but as i said i need something like a forcer, with the beam etc and in tool form

Just use negative values…

Make sure all the initial values are positive, like range and multiplier, but not velocity or force, from the actual forcer, those should be negative.