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