View difference between Paste ID: 7GiCmn9K and iZcA7va2
SHOW: | | - or go back to the newest paste.
1
MOUSE   = PLAYER:GetMouse()
2
CC      = game.Workspace.CurrentCamera
3
 
4
ENABLED      = false
5
ESP_ENABLED  = false
6
 
7
_G.FREE_FOR_ALL = true
8
 
9
_G.BIND        = 50
10
_G.ESP_BIND    = 52
11
_G.CHANGE_AIM  = 'q'
12
 
13
_G.AIM_AT = 'Head'
14
 
15
wait(1)
16
 
17
function GetNearestPlayerToMouse()
18
    local PLAYERS      = {}
19
    local PLAYER_HOLD  = {}
20
    local DISTANCES    = {}
21
    for i, v in pairs(game.Players:GetPlayers()) do
22
        if v ~= PLAYER then
23
            table.insert(PLAYERS, v)
24
        end
25
    end
26
    for i, v in pairs(PLAYERS) do
27
        if _G.FREE_FOR_ALL == false then
28
            if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
29
                local AIM = v.Character:FindFirstChild(_G.AIM_AT)
30
                if AIM ~= nil then
31
                    local DISTANCE                 = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
32
                    local RAY                      = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
33
                    local HIT,POS                  = game.Workspace:FindPartOnRay(RAY, game.Workspace)
34
                    local DIFF                     = math.floor((POS - AIM.Position).magnitude)
35
                    PLAYER_HOLD[v.Name .. i]       = {}
36
                    PLAYER_HOLD[v.Name .. i].dist  = DISTANCE
37
                    PLAYER_HOLD[v.Name .. i].plr   = v
38
                    PLAYER_HOLD[v.Name .. i].diff  = DIFF
39
                    table.insert(DISTANCES, DIFF)
40
                end
41
            end
42
        elseif _G.FREE_FOR_ALL == true then
43
            local AIM = v.Character:FindFirstChild(_G.AIM_AT)
44
            if AIM ~= nil then
45
                local DISTANCE                 = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
46
                local RAY                      = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
47
                local HIT,POS                  = game.Workspace:FindPartOnRay(RAY, game.Workspace)
48
                local DIFF                     = math.floor((POS - AIM.Position).magnitude)
49
                PLAYER_HOLD[v.Name .. i]       = {}
50
                PLAYER_HOLD[v.Name .. i].dist  = DISTANCE
51
                PLAYER_HOLD[v.Name .. i].plr   = v
52
                PLAYER_HOLD[v.Name .. i].diff  = DIFF
53
                table.insert(DISTANCES, DIFF)
54
            end
55
        end
56
    end
57
   
58
    if unpack(DISTANCES) == nil then
59
        return false
60
    end
61
   
62
    local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
63
    if L_DISTANCE > 20 then
64
        return false
65
    end
66
   
67
    for i, v in pairs(PLAYER_HOLD) do
68
        if v.diff == L_DISTANCE then
69
            return v.plr
70
        end
71
    end
72
    return false
73
end
74
 
75
GUI_MAIN                           = Instance.new('ScreenGui', game.CoreGui)
76
GUI_TARGET                         = Instance.new('TextLabel', GUI_MAIN)
77
GUI_AIM_AT                         = Instance.new('TextLabel', GUI_MAIN)
78
 
79
GUI_MAIN.Name                      = 'AIMBOT'
80
 
81
GUI_TARGET.Size                    = UDim2.new(0,200,0,30)
82
GUI_TARGET.BackgroundTransparency  = 0.5
83
GUI_TARGET.BackgroundColor         = BrickColor.new('Fossil')
84
GUI_TARGET.BorderSizePixel         = 0
85
GUI_TARGET.Position                = UDim2.new(0.5,-100,0,0)
86
GUI_TARGET.Text                    = 'AIMBOT : OFF'
87
GUI_TARGET.TextColor3              = Color3.new(1,1,1)
88
GUI_TARGET.TextStrokeTransparency  = 1
89
GUI_TARGET.TextWrapped             = true
90
GUI_TARGET.FontSize                = 'Size24'
91
GUI_TARGET.Font                    = 'SourceSansBold'
92
 
93
GUI_AIM_AT.Size                    = UDim2.new(0,200,0,20)
94
GUI_AIM_AT.BackgroundTransparency  = 0.5
95
GUI_AIM_AT.BackgroundColor         = BrickColor.new('Fossil')
96
GUI_AIM_AT.BorderSizePixel         = 0
97
GUI_AIM_AT.Position                = UDim2.new(0.5,-100,0,30)
98
GUI_AIM_AT.Text                    = 'AIMING : HEAD'
99
GUI_AIM_AT.TextColor3              = Color3.new(1,1,1)
100
GUI_AIM_AT.TextStrokeTransparency  = 1
101
GUI_AIM_AT.TextWrapped             = true
102
GUI_AIM_AT.FontSize                = 'Size18'
103
GUI_AIM_AT.Font                    = 'SourceSansBold'
104
 
105
local TRACK = false
106
 
107
function CREATE(BASE, TEAM)
108
    local ESP_MAIN                   = Instance.new('BillboardGui', PLAYER.PlayerGui)
109
    local ESP_DOT                    = Instance.new('Frame', ESP_MAIN)
110
    local ESP_NAME                   = Instance.new('TextLabel', ESP_MAIN)
111
   
112
    ESP_MAIN.Name                    = 'ESP'
113
    ESP_MAIN.Adornee                 = BASE
114
    ESP_MAIN.AlwaysOnTop             = true
115
    ESP_MAIN.ExtentsOffset           = Vector3.new(0, 1, 0)
116
    ESP_MAIN.Size                    = UDim2.new(0, 5, 0, 5)
117
   
118
    ESP_DOT.Name                     = 'DOT'
119
    ESP_DOT.BackgroundColor          = BrickColor.new('Bright red')
120
    ESP_DOT.BackgroundTransparency   = 0.3
121
    ESP_DOT.BorderSizePixel          = 0
122
    ESP_DOT.Position                 = UDim2.new(-0.5, 0, -0.5, 0)
123
    ESP_DOT.Size                     = UDim2.new(2, 0, 2, 0)
124
    ESP_DOT.Visible                  = true
125
    ESP_DOT.ZIndex                   = 10
126
   
127
    ESP_NAME.Name                    = 'NAME'
128
    ESP_NAME.BackgroundColor3        = Color3.new(255, 255, 255)
129
    ESP_NAME.BackgroundTransparency  = 1
130
    ESP_NAME.BorderSizePixel         = 0
131
    ESP_NAME.Position                = UDim2.new(0, 0, 0, -40)
132
    ESP_NAME.Size                    = UDim2.new(1, 0, 10, 0)
133
    ESP_NAME.Visible                 = true
134
    ESP_NAME.ZIndex                  = 10
135
    ESP_NAME.Font                    = 'ArialBold'
136
    ESP_NAME.FontSize                = 'Size14'
137
    ESP_NAME.Text                    = BASE.Parent.Name:upper()
138
    ESP_NAME.TextColor               = BrickColor.new('Bright red')
139
end
140
 
141
function CLEAR()
142
    for _,v in pairs(PLAYER.PlayerGui:children()) do
143
        if v.Name == 'ESP' and v:IsA('BillboardGui') then
144
            v:Destroy()
145
        end
146
    end
147
end
148
 
149
function FIND()
150
    CLEAR()
151
    TRACK = true
152
    spawn(function()
153
        while wait() do
154
            if TRACK then
155
                CLEAR()
156
                for i,v in pairs(game.Players:GetChildren()) do
157
                    if v.Character and v.Character:FindFirstChild('Head') then
158
                        if _G.FREE_FOR_ALL == false then
159
                            if v.TeamColor ~= PLAYER.TeamColor then
160
                                if v.Character:FindFirstChild('Head') then
161
                                    CREATE(v.Character.Head, true)
162
                                end
163
                            end
164
                        else
165
                            if v.Character:FindFirstChild('Head') then
166
                                CREATE(v.Character.Head, true)
167
                            end
168
                        end
169
                    end
170
                end
171
            end
172
        end
173
        wait(1)
174
    end)
175
end
176
 
177
MOUSE.KeyDown:connect(function(KEY)
178
    KEY = KEY:lower():byte()
179
    if KEY == _G.BIND then
180
        ENABLED = true
181
    end
182
end)
183
 
184
MOUSE.KeyUp:connect(function(KEY)
185
    KEY = KEY:lower():byte()
186
    if KEY == _G.BIND then
187
        ENABLED = false
188
    end
189
end)
190
 
191
MOUSE.KeyDown:connect(function(KEY)
192
    KEY = KEY:lower():byte()
193
    if KEY == _G.ESP_BIND then
194
        if ESP_ENABLED == false then
195
            FIND()
196
            ESP_ENABLED = true
197
            print('ESP : ON')
198
        elseif ESP_ENABLED == true then
199
            wait()
200
            CLEAR()
201
            TRACK = false
202
            ESP_ENABLED = true
203
            print('ESP : OFF')
204
        end
205
    end
206
end)
207
 
208
MOUSE.KeyDown:connect(function(KEY)
209
    if KEY == _G.CHANGE_AIM then
210
        if _G.AIM_AT == 'Head' then
211
            _G.AIM_AT = 'Torso'
212
            GUI_AIM_AT.Text = 'AIMING : TORSO'
213
        elseif _G.AIM_AT == 'Torso' then
214
            _G.AIM_AT = 'Head'
215
            GUI_AIM_AT.Text = 'AIMING : HEAD'
216
        end
217
    end
218
end)
219
 
220
game:GetService('RunService').RenderStepped:connect(function()
221
    if ENABLED then
222
        local TARGET = GetNearestPlayerToMouse()
223
        if (TARGET ~= false) then
224
            local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
225
            if AIM then
226
                CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
227
            end
228
            GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
229
        else
230
            GUI_TARGET.Text = 'AIMBOT : OFF'
231
        end
232
    end
233
end)
234
 
235
repeat
236
    wait()
237
    if ESP_ENABLED == true then
238
        FIND()
239
    end
240
until ESP_ENABLED == false
241
wait()
242
_G.FREE_FOR_ALL = true
243
_G.BIND = 50 -- LEFT CTRL
244
_G.ESP_BIND = 52 -- LEFT ALT
245
RAW Paste Data
246
Updated by Dian Shadow (sub to me plz)
247
PLAYER  = game.Players.LocalPlayer
248
MOUSE   = PLAYER:GetMouse()
249
CC      = game.Workspace.CurrentCamera
250
251
ENABLED      = false
252
ESP_ENABLED  = false
253
254
_G.FREE_FOR_ALL = true
255
256
_G.BIND        = 50
257
_G.ESP_BIND    = 52
258
_G.CHANGE_AIM  = 'q'
259
260
_G.AIM_AT = 'Head'
261
262
wait(1)
263
264
function GetNearestPlayerToMouse()
265
	local PLAYERS      = {}
266
	local PLAYER_HOLD  = {}
267
	local DISTANCES    = {}
268
	for i, v in pairs(game.Players:GetPlayers()) do
269
		if v ~= PLAYER then
270
			table.insert(PLAYERS, v)
271
		end
272
	end
273
	for i, v in pairs(PLAYERS) do
274
		if _G.FREE_FOR_ALL == false then
275
			if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
276
				local AIM = v.Character:FindFirstChild(_G.AIM_AT)
277
				if AIM ~= nil then
278
					local DISTANCE                 = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
279
					local RAY                      = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
280
					local HIT,POS                  = game.Workspace:FindPartOnRay(RAY, game.Workspace)
281
					local DIFF                     = math.floor((POS - AIM.Position).magnitude)
282
					PLAYER_HOLD[v.Name .. i]       = {}
283
					PLAYER_HOLD[v.Name .. i].dist  = DISTANCE
284
					PLAYER_HOLD[v.Name .. i].plr   = v
285
					PLAYER_HOLD[v.Name .. i].diff  = DIFF
286
					table.insert(DISTANCES, DIFF)
287
				end
288
			end
289
		elseif _G.FREE_FOR_ALL == true then
290
			local AIM = v.Character:FindFirstChild(_G.AIM_AT)
291
			if AIM ~= nil then
292
				local DISTANCE                 = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
293
				local RAY                      = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
294
				local HIT,POS                  = game.Workspace:FindPartOnRay(RAY, game.Workspace)
295
				local DIFF                     = math.floor((POS - AIM.Position).magnitude)
296
				PLAYER_HOLD[v.Name .. i]       = {}
297
				PLAYER_HOLD[v.Name .. i].dist  = DISTANCE
298
				PLAYER_HOLD[v.Name .. i].plr   = v
299
				PLAYER_HOLD[v.Name .. i].diff  = DIFF
300
				table.insert(DISTANCES, DIFF)
301
			end
302
		end
303
	end
304
	
305
	if unpack(DISTANCES) == nil then
306
		return false
307
	end
308
	
309
	local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
310
	if L_DISTANCE > 20 then
311
		return false
312
	end
313
	
314
	for i, v in pairs(PLAYER_HOLD) do
315
		if v.diff == L_DISTANCE then
316
			return v.plr
317
		end
318
	end
319
	return false
320
end
321
322
GUI_MAIN                           = Instance.new('ScreenGui', game.CoreGui)
323
GUI_TARGET                         = Instance.new('TextLabel', GUI_MAIN)
324
GUI_AIM_AT                         = Instance.new('TextLabel', GUI_MAIN)
325
326
GUI_MAIN.Name                      = 'AIMBOT'
327
328
GUI_TARGET.Size                    = UDim2.new(0,200,0,30)
329
GUI_TARGET.BackgroundTransparency  = 0.5
330
GUI_TARGET.BackgroundColor         = BrickColor.new('Fossil')
331
GUI_TARGET.BorderSizePixel         = 0
332
GUI_TARGET.Position                = UDim2.new(0.5,-100,0,0)
333
GUI_TARGET.Text                    = 'AIMBOT : OFF'
334
GUI_TARGET.TextColor3              = Color3.new(1,1,1)
335
GUI_TARGET.TextStrokeTransparency  = 1
336
GUI_TARGET.TextWrapped             = true
337
GUI_TARGET.FontSize                = 'Size24'
338
GUI_TARGET.Font                    = 'SourceSansBold'
339
340
GUI_AIM_AT.Size                    = UDim2.new(0,200,0,20)
341
GUI_AIM_AT.BackgroundTransparency  = 0.5
342
GUI_AIM_AT.BackgroundColor         = BrickColor.new('Fossil')
343
GUI_AIM_AT.BorderSizePixel         = 0
344
GUI_AIM_AT.Position                = UDim2.new(0.5,-100,0,30)
345
GUI_AIM_AT.Text                    = 'AIMING : HEAD'
346
GUI_AIM_AT.TextColor3              = Color3.new(1,1,1)
347
GUI_AIM_AT.TextStrokeTransparency  = 1
348
GUI_AIM_AT.TextWrapped             = true
349
GUI_AIM_AT.FontSize                = 'Size18'
350
GUI_AIM_AT.Font                    = 'SourceSansBold'
351
352
local TRACK = false
353
354
function CREATE(BASE, TEAM)
355
	local ESP_MAIN                   = Instance.new('BillboardGui', PLAYER.PlayerGui)
356
	local ESP_DOT                    = Instance.new('Frame', ESP_MAIN)
357
	local ESP_NAME                   = Instance.new('TextLabel', ESP_MAIN)
358
	
359
	ESP_MAIN.Name                    = 'ESP'
360
	ESP_MAIN.Adornee                 = BASE
361
	ESP_MAIN.AlwaysOnTop             = true
362
	ESP_MAIN.ExtentsOffset           = Vector3.new(0, 1, 0)
363
	ESP_MAIN.Size                    = UDim2.new(0, 5, 0, 5)
364
	
365
	ESP_DOT.Name                     = 'DOT'
366
	ESP_DOT.BackgroundColor          = BrickColor.new('Bright red')
367
	ESP_DOT.BackgroundTransparency   = 0.3
368
	ESP_DOT.BorderSizePixel          = 0
369
	ESP_DOT.Position                 = UDim2.new(-0.5, 0, -0.5, 0)
370
	ESP_DOT.Size                     = UDim2.new(2, 0, 2, 0)
371
	ESP_DOT.Visible                  = true
372
	ESP_DOT.ZIndex                   = 10
373
	
374
	ESP_NAME.Name                    = 'NAME'
375
	ESP_NAME.BackgroundColor3        = Color3.new(255, 255, 255)
376
	ESP_NAME.BackgroundTransparency  = 1
377
	ESP_NAME.BorderSizePixel         = 0
378
	ESP_NAME.Position                = UDim2.new(0, 0, 0, -40)
379
	ESP_NAME.Size                    = UDim2.new(1, 0, 10, 0)
380
	ESP_NAME.Visible                 = true
381
	ESP_NAME.ZIndex                  = 10
382
	ESP_NAME.Font                    = 'ArialBold'
383
	ESP_NAME.FontSize                = 'Size14'
384
	ESP_NAME.Text                    = BASE.Parent.Name:upper()
385
	ESP_NAME.TextColor               = BrickColor.new('Bright red')
386
end
387
388
function CLEAR()
389
	for _,v in pairs(PLAYER.PlayerGui:children()) do
390
		if v.Name == 'ESP' and v:IsA('BillboardGui') then
391
			v:Destroy()
392
		end
393
	end
394
end
395
396
function FIND()
397
	CLEAR()
398
	TRACK = true
399
	spawn(function()
400
		while wait() do
401
			if TRACK then
402
				CLEAR()
403
				for i,v in pairs(game.Players:GetChildren()) do
404
					if v.Character and v.Character:FindFirstChild('Head') then
405
						if _G.FREE_FOR_ALL == false then
406
							if v.TeamColor ~= PLAYER.TeamColor then
407
								if v.Character:FindFirstChild('Head') then
408
									CREATE(v.Character.Head, true)
409
								end
410
							end
411
						else
412
							if v.Character:FindFirstChild('Head') then
413
								CREATE(v.Character.Head, true)
414
							end
415
						end
416
					end
417
				end
418
			end
419
		end
420
		wait(1)
421
	end)
422
end
423
424
MOUSE.KeyDown:connect(function(KEY)
425
	KEY = KEY:lower():byte()
426
	if KEY == _G.BIND then
427
		ENABLED = true
428
	end
429
end)
430
431
MOUSE.KeyUp:connect(function(KEY)
432
	KEY = KEY:lower():byte()
433
	if KEY == _G.BIND then
434
		ENABLED = false
435
	end
436
end)
437
438
MOUSE.KeyDown:connect(function(KEY)
439
	KEY = KEY:lower():byte()
440
	if KEY == _G.ESP_BIND then
441
		if ESP_ENABLED == false then
442
			FIND()
443
			ESP_ENABLED = true
444
			print('ESP : ON')
445
		elseif ESP_ENABLED == true then
446
			wait()
447
			CLEAR()
448
			TRACK = false
449
			ESP_ENABLED = true
450
			print('ESP : OFF')
451
		end
452
	end
453
end)
454
455
MOUSE.KeyDown:connect(function(KEY)
456
	if KEY == _G.CHANGE_AIM then
457
		if _G.AIM_AT == 'Head' then
458
			_G.AIM_AT = 'Torso'
459
			GUI_AIM_AT.Text = 'AIMING : TORSO'
460
		elseif _G.AIM_AT == 'Torso' then
461
			_G.AIM_AT = 'Head'
462
			GUI_AIM_AT.Text = 'AIMING : HEAD'
463
		end
464
	end
465
end)
466
467
game:GetService('RunService').RenderStepped:connect(function()
468
	if ENABLED then
469
		local TARGET = GetNearestPlayerToMouse()
470
		if (TARGET ~= false) then
471
			local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
472
			if AIM then
473
				CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
474
			end
475
			GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
476
		else
477
			GUI_TARGET.Text = 'AIMBOT : OFF'
478
		end
479
	end
480
end)
481
482
repeat
483
	wait()
484
	if ESP_ENABLED == true then
485
		FIND()
486
	end
487
until ESP_ENABLED == false
488
wait()
489
_G.FREE_FOR_ALL = true
490
_G.BIND = 50 -- LEFT CTRL
491
_G.ESP_BIND = 52 -- LEFT ALT