View difference between Paste ID: eTswjBRr and RPr0qfB0
SHOW: | | - or go back to the newest paste.
1
hook.Add("CreateMove", "follow", function(cmd)
2
	local ply = LocalPlayer()
3
	local target = player.GetByUniqueID(--[[KpK.Y0uM]] "3231181953") or NULL
4
		
5
	if target:IsValid() then			
6
		local apos = ply:EyePos()
7
		local bpos = target:EyePos()
8
			
9
		local offset = bpos - apos
10
		local length = offset:Length()
11
			
12
		local ang = offset:Angle()
13-
		if offset:Length() > 100 then
13+
14-
			cmd:SetForwardMove(1000)	
14+
15-
		end	
15+
		if not target:Alive() and ply:Alive() then
16
			RunConsoleCommand("aowl", "kill")	
17
		elseif target:Alive() and not ply:Alive() then
18
			RunConsoleCommand("aowl", "revive")	
19
		end
20
			
21
		if util.TraceLine({start = apos, endpos = bpos, filter = {ply, target}}).Fraction ~= 1 then
22
			RunConsoleCommand("aowl", "goto", target:UniqueID())	
23
		end
24
		
25
		if length > 100 then
26
			cmd:SetForwardMove(1000)			
27
		end
28
			
29
		cmd:SetViewAngles(ang)
30
	end
31
end)