View difference between Paste ID: CXYG2azT and 5LqXX5PD
SHOW: | | - or go back to the newest paste.
1
if leleltru then
2
		local lelp={}
3
		local lelt={}
4
		local bestp
5
		local aimbased=true
6
		local weightbased=false
7
		local sightbased=true
8
		local autoshoot=false
9
		local shooting=false
10
		input.keyboard.onkeydown:connect(function(key)
11
			if input.keyboard.down.leftalt then
12
				if key=="u" then
13
					autoshoot=not autoshoot
14
					print("autoshoot",autoshoot)
15
				elseif key=="j" then
16
					aimbased=not aimbased
17
					print("aim",aimbased)
18
				elseif key=="k" then
19
					weightbased=not weightbased
20
					print("weight",weightbased)
21
				elseif key=="l" then
22
					sightbased=not sightbased
23
					print("sight",sightbased)
24
				end
25
			end
26
		end)
27
		char.aimbotstep=function()
28
			local players=game.Players:GetChildren()
29
			for i,v in next,players do
30
				if v.Character and v.Character:FindFirstChild("Head") then
31
					if not lelp[v] then
32
						lelp[v]={}
33
					end
34
					table.insert(lelp[v],1,v.Character.Head.Position)
35
					table.remove(lelp[v],17)
36
				else
37
					lelp[v]=nil
38
				end
39
			end
40
			table.insert(lelt,1,tick())
41
			table.remove(lelt,17)
42
			local ignorelist={camera.currentcamera,character,workspace.Ignore}
43
			if input.keyboard.down["leftalt"] and weapon and aimbotshit.speed then
44
				aimbotshit.fuckoff=true
45
				if bestp and hud:getplayerhealth(bestp)<=0 or not bestp then
46
					bestp=nil
47
				--[[local bestdot=1-2^-5
48
					for i,v in next,players do
49
						if lelp[v] and v~=game.Players.LocalPlayer and v.TeamColor~=game.Players.LocalPlayer.TeamColor then
50
							--print(lelp[v][1])
51
							local whatever=vector.anglesyx(camera.angles.x,camera.angles.y):Dot((lelp[v][1]-camera.cframe.p).unit)
52
							if whatever>bestdot then
53
								bestdot=whatever--hud:getplayerhealth(
54
								bestp=v
55
							end
56
						end
57
					end]]
58
					--NEW ALG
59
					local look=vector.anglesyx(camera.angles.x,camera.angles.y)
60
					local bestscore=0
61
					for i,v in next,players do
62
						ignorelist[#ignorelist+1]=v.Character
63
					end
64
					for i,v in next,players do
65
						if lelp[v] and v~=game.Players.LocalPlayer and v.TeamColor~=game.Players.LocalPlayer.TeamColor then
66
							local rel=lelp[v][1]-camera.cframe.p
67
							local lookvalue=look:Dot(rel.unit)
68
							lookvalue=math.pi-math.acos(lookvalue<-1 and -1 or lookvalue<1 and lookvalue or 1)
69
							local tlook=replication.playerangles(v)
70
							local tlookvalue=-vector.anglesyx(tlook.x,tlook.y):Dot(rel.unit)
71
							tlookvalue=math.pi-math.acos(tlookvalue<-1 and -1 or tlookvalue<1 and tlookvalue or 1)
72
							local healthvalue=hud:getplayerhealth(v)
73
							healthvalue=healthvalue<=0 and 0 or 1/healthvalue
74
							local distvalue=1/rel.magnitude
75
							local score=(aimbased and lookvalue or 1)*(weightbased and tlookvalue*healthvalue*distvalue or 1)
76
							if score>bestscore then
77
								local lel=raycast(workspace,ray(camera.cframe.p,rel),ignorelist)
78
								if sightbased and not lel or not sightbased then
79
									bestscore=score
80
									bestp=v
81
								end
82
							end
83
						end
84
					end
85
				end
86
				if bestp then
87
					local bestlelp=lelp[bestp]
88
					local lel=raycast(workspace,ray(camera.cframe.p,bestlelp[1]-camera.cframe.p),ignorelist)
89
					if sightbased and lel then
90
						bestp=nil
91
					end
92
					local v=physics.trajectory(camera.cframe.p,aimbotshit.addv and rootpart.Velocity/loltimescale or nv,aimbotshit.accel,bestlelp[1],(bestlelp[1]-bestlelp[#bestlelp])/(lelt[1]-lelt[#bestlelp]),nv,aimbotshit.speed)
93
					--print(bestpart.Velocity)
94
					--print(bestlelp[1],(bestlelp[1]-bestlelp[#bestlelp])/(lelt[1]-lelt[#bestlelp]))
95
					if v then
96
						camera:setlookvector(v)
97
						if autoshoot then
98
							shooting=true
99
						end
100
					else
101
						if autoshoot and shooting then
102
							shooting=false
103
							weapon:shoot(false)
104
							if weapon.setaim then weapon:setaim(false) end
105
						end
106
					end
107
				else
108
					if autoshoot and shooting then
109
						shooting=false
110
						weapon:shoot(false)
111
						if weapon.setaim then weapon:setaim(false) end
112
					end
113
				end
114
			else
115
				if shooting then
116
					shooting=false
117
					weapon:shoot(false)
118
					if weapon.setaim then weapon:setaim(false) end
119
				end
120
				bestp=nil
121
				aimbotshit.fuckoff=nil
122
			end
123
		end
124
		function char.lelelelelstep()
125
			if shooting and autoshoot then
126
				if weapon.setaim then weapon:setaim(true) end
127
				weapon:shoot(true)
128
			end
129
		end
130
	else
131
		char.aimbotstep=function() end
132
		char.lelelelelstep=function() end
133
	end