Need some help tweaking this tornoado

First of all let me be clear; I did not make this code. It came from a weather mod I got on garrysmod.org. What I want to do is make the tornado pull things from farther away, and pull them up more, rather than slingshot them around the map.

Here is the code:


AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')

ENT.SC_Immune = true

function ENT:SpawnFunction( ply, tr)
	local SpawnPos = tr.HitPos + tr.HitNormal * 25
	local ent = ents.Create( "wm_tornado" )
	ent:SetPos( SpawnPos )
	ent:Spawn()
	ent:Activate()
	return ent
end

function ENT:Initialize()
	self.Entity:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	--self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )	
	self.Entity:SetMoveType( MOVETYPE_NONE )
	self.Entity:SetUseType( SIMPLE_USE )
	
	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end 
	
	--self:SetName("tornado"..self:EntIndex())
	
	self.Inputs = Wire_CreateInputs( self.Entity, { "Fire","Scale" } )   	
	self.sFScale = 0
	self:SetNWFloat("FScale", 0)
	self.delay = CurTime() + 0.50
	self.PhysDelay = CurTime() + 0.05
	/*
	self.Sound01 = ents.Create("ambient_generic")
		self.Sound01:SetPos(self:GetPos())
		self.Sound01:SetKeyValue( "SourceEntityName", "tornado"..self:EntIndex() )
		self.Sound01:SetKeyValue( "radius", 1024 )
		self.Sound01:SetKeyValue( "message", "ambient\levels\canals\windmill_wind_loop1.wav" )
		self.Sound01:Fire("PlaySound", "", 0)
		self.Sound01:Spawn()
		self.Sound01:Activate()
	*/
	--ambient\levels\canals\windmill_wind_loop1.wav
	--ambient\wind\wind_hit3.wav --1-3
	--ambient\wind\wind_med2.wav --1-2
	--ambient\wind\windgust.wav
	--ambient\wind\windgust_strong.wav
	
	self.Sound01 = CreateSound( self, Sound("ambient/levels/canals/windmill_wind_loop1.wav") )
	--self.Sound01:SetSoundLevel(10000) --This don't work
	self.Sound01:PlayEx(100,100)
	--self.Sound01:Play()
	--self.Sound01:SetSoundLevel(SNDLVL_180dB)
	
	--self.Sound02 = CreateSound( self, Sound("ambient/atmosphere/plaza_amb.wav") )
	--self.Sound02:PlayEx(1,100)

	/*
	self.SoundOutput = ents.Create("ambient_generic") //magic begins
	self.SoundOutput:SetName("wm_tornado_sound_"..self:EntIndex())
	self.SoundOutput:SetPos(self.Entity:GetPos())
	self.SoundOutput:SetParent(self.Entity)
	self.SoundOutput:SetOwner(self.Entity:GetOwner())
	self.SoundOutput:SetKeyValue("message", "ambient/levels/canals/windmill_wind_loop1.wav")
	self.SoundOutput:SetKeyValue("health", "5")
	self.SoundOutput:SetKeyValue("spawnflags","16") //looped, and silent
	self.SoundOutput:SetKeyValue("radius", "100000")
	
	self.SoundOutput:Spawn()
	self.SoundOutput:Activate()
	
	self.SoundOutput:Fire("Volume", 10, 0)
	self.SoundOutput:Fire("Pitch", 100, 0)
	self.SoundOutput:Fire("PlaySound", "", 0)
	*/
	
	self.particles = {}
	
	local fx = EffectData()
		fx:SetScale(self.sFScale)
		fx:SetEntity(self)
		util.Effect("wm_tornado",fx,true,true)
		
	self.ThirtySecond = CurTime() + 30
	

end

function ENT:OnRemove()

 	self.Sound01:Stop()
 	--self.Sound02:Stop()
 	--self.Sound03:Stop()
 	
 	--self.SoundOutput:Fire("PlaySound", "", 0)
 	
 	--self.SoundOutput:Remove()
end



function ENT:OnTakeDamage(dmg)

end

function ENT:Think()

	if self.ThirtySecond < CurTime() then
		self.ThirtySecond = self.ThirtySecond + 30
	    self:Think_30s()
	end

	if self.WallCloud and self.WallCloud:IsValid() then
    	self:SetPos(self.WallCloud:GetPos() - Vector(0,0,2150))
    end

	if CurTime() > self.delay then
		self.delay = CurTime() + 0.5	
		self:SetNWFloat("FScale", self.sFScale)
	end  		
	
	if CurTime() > self.PhysDelay then 
		self.PhysDelay = CurTime() + 0.05
		local range = (80*2^self.sFScale) + (318*self.sFScale)
		
		local e = ents.FindInSphere(self:GetPos(), range)
		for k,v in pairs(e) do
			if v:IsValid() and v != self and v:GetPhysicsObject():IsValid() and not (string.find(tostring(v),"Particle")) and not (string.find(v:GetClass(),"wm_")) and not (v:GetClass() == "gmod_ghost") and !v:IsWorld() and !v:IsWeapon() and not (v:GetClass() == "sent_anim") then
				local physobj = v:GetPhysicsObject()
				if physobj:IsValid() then

				    local trace = {
	        			start = self:GetPos(),
						endpos = v:GetPos(),
						filter = self
					}

	        		 tr = util.TraceLine( trace )
				
					local origin = self:GetPos()
					local vorigin = v:GetPos() 					
					local Pull = ((self:GetPos() - v:GetPos()):Normalize())
					local Pull2 = self:GetPos() - v:GetPos()
					local Length = Vector(Pull2.x,Pull2.y,0):Length()
					
					local ZDif = (Vector(0,0,origin.z) - Vector(0,0,vorigin.z)):Length()
					--print(ZDif)
					
					Pull = Vector(Pull.x, Pull.y, 0.325*math.Clamp(1-(ZDif/(range/7)), 0, 1))
					Pull = Pull * ( (1-(Length/range))^3.3 )
					local force = Pull * (64000*(2^(self.sFScale^1.425)))
					local force2 = Pull * (64000*(2^(self.sFScale^1.425)))
					force2:Rotate(Angle(0,-90,0))
					local force3 = (((force*0.55) + (force2*0.45))) --Adjust ratio between pull and spin
					local mass = physobj:GetMass()
					local gMul = 1
					if v:IsOnGround() then
					    gMul = 3.33
					end
					
					--Somthing is sucking up particles from other ents..
					if v:GetMoveType() != MOVETYPE_NOCLIP and (v:IsPlayer() or v:IsNPC()) and v:IsValid() and (not string.find(tostring(v),"CLuaParticle")) then
					
						if v.AddVelocity then
							v:AddVelocity( Vector(math.Clamp((force3.x/2)/mass,-150,150),math.Clamp((force3.y/2)/mass,-150,150),math.Clamp((force3.z/2)/mass,-150,150)) * gMul )
						else
							v:SetVelocity( Vector(math.Clamp((force3.x/2)/mass,-150,150),math.Clamp((force3.y/2)/mass,-150,150),math.Clamp((force3.z/2)/mass,-150,150)) * gMul )
						end					
					end
					
					if (v:IsPlayer() and v:InVehicle()) or v:IsVehicle() then
			    	else
			    	    if v:IsPlayer() and tr.HitWorld then
			    	    else
							v:TakeDamage( (0.2*(self.sFScale^3)) * ( (1-(Length/range))^5 ), self, self ) --Hurt stuff inside the funnel
						end
					end
					
					if not string.find(tostring(v),"CLuaParticle") then  --Somthing is sucking up particles from other ents..
						physobj:AddVelocity(Vector(math.Clamp(force3.x/mass,-500,500), math.Clamp(force3.y/mass,-500,500), math.Clamp(force3.z/mass * gMul,-500,500))  )
					end
					
				end				
			end
		end		
	end
end

function ENT:Think_30s()
	print("Tornado Particle Count: "..table.Count(self.particles))
	
	if WM_GetPart() then
    	local fx = EffectData()
		fx:SetScale(self.sFScale)
		fx:SetEntity(self)
		util.Effect("wm_tornado",fx)
	end
	
end

function ENT:Use(ply,caller)
    local fx = EffectData()
		fx:SetScale(self.sFScale)
		fx:SetEntity(self)
		util.Effect("wm_tornado",fx,true,true)
end

function ENT:TriggerInput(iname, value)
	if (iname == "Scale") then 		
    	self.sFScale = math.Clamp(value,0,5)     	  
	elseif iname == "Fire" then
		if value == 1 then
			local fx = EffectData()
			fx:SetScale(self.sFScale)
			fx:SetEntity(self)
			util.Effect("wm_tornado",fx,true,true)
		end 		 
	end
end





local force3 = (((force*0.55) + (force2*0.45))) --Adjust ratio between pull and spin


Maybe editing this?

I considered that, but I wasn’t sure of how it would affect the tornado. I am going to assume reducing the spin multiplier will reduce the slingshot effect. But I wasn’t sure what the pull meant, whether it means upward pull or distance pull. I’ll play with it now though, seeing as my server is currently empty >:]

It seems that this weather mod has quite a few bugs. Mostly errors complaining about trying to use NULL entities… anyone up for trying to fix it? I tried, but I am not good with LUA -_- so my if statement was rubbish.

Lua Error: addons\weather\lua\entities\wm_wall\init.lua:99: bad argument #1 to ‘SetPos’ (Vector expected, got nil)

effects\wm_super_storm\init.lua:11: Tried to use a NULL entity!
effects\wm_super_storm\init.lua:52: attempt to compare nil with number