-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaimstars.lua
114 lines (99 loc) · 3.53 KB
/
aimstars.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
getgenv().aimkey = getgenv().aimkey or 'f'
getgenv().autoclick = getgenv().autoclick or true
local plr = game.Players.LocalPlayer
local mouse2 = plr:GetMouse()
local char = plr.Character
local camera = game.Workspace.CurrentCamera
local rs = game:GetService('RunService')
local uis = game:GetService('UserInputService')
local folder = game.Workspace:FindFirstChild('Bots') or game.Workspace:FindFirstChildOfClass('MeshPart')
local physicalIgnore = game.Workspace.physicalIgnore
local mode
local mt = getrawmetatable(game)
local old = mt.__namecall
setreadonly(mt, false)
mt.__namecall = function(self, ...)
local method = getnamecallmethod()
local args = {...}
if method == 'Kick' then
print('kick attempt', ...)
return
end
return old(self, unpack(args))
end
setreadonly(mt, true)
repeat wait(0.5) print('not found')
if folder.ClassName == 'Folder' then
if folder:FindFirstChild('Part') and folder:FindFirstChild('Part'):FindFirstChild('Target') then
mode = 'part'
print('mode set to part')
elseif folder:FindFirstChild('Bot') and folder:FindFirstChild('Bot'):FindFirstChild('Humanoid') then
mode = 'bot'
print('mode set to bot')
elseif folder:FindFirstChild('Sphere') and folder:FindFirstChild('Sphere'):FindFirstChild('Target') then
mode = 'sphere'
print('mode set to sphere')
end
end
until mode
for i,v in pairs(physicalIgnore:GetChildren()) do
if v.Name == 'Barrier' then
v:Destroy()
end
end
print('ready to load')
wait()
function findtarget()
if mode == 'bot' then
for i,v in pairs(folder:GetChildren()) do
if v:FindFirstChild('Head') then
local h,isonscreen = camera:WorldToViewportPoint(v:FindFirstChild('Head').Position)
if isonscreen then
return v.Head
end
elseif v:FindFirstChild('Torso') then
local h,isonscreen = camera:WorldToViewportPoint(v:FindFirstChild('Torso').Position)
if isonscreen and v.Torso then
return v.Torso
end
end
end
elseif mode == 'part' then
for i,v in pairs(folder:GetChildren()) do
if v.Name == 'Part' and v.Target.Value == 'Target' and v.Transparency ~= 1 then
local h,isonscreen = camera:WorldToViewportPoint(v.Position)
if isonscreen then
return v
end
end
end
elseif mode == 'sphere' then
for i,v in pairs(folder:GetChildren()) do
if v.Name == 'Sphere' and v.Target.Value == 'Target' and v.Transparency ~= 1 then
local h,isonscreen = camera:WorldToViewportPoint(v.Position)
if isonscreen then
return v
end
end
end
end
end
print('f1 initialized')
function AimAt(instance)
local v = camera:WorldToViewportPoint(instance.Position)
local mouse = uis:GetMouseLocation()
if uis:IsKeyDown(Enum.KeyCode[getgenv().aimkey:upper()]) then
mousemoverel((v.X - mouse.X), (v.Y - mouse.Y))
end
end
print('f2 initialized')
rs.RenderStepped:Connect(function()
local part = findtarget()
pcall(AimAt, part)
print(mouse2.Target)
if getgenv().autoclick and (mouse2.Target:IsDescendantOf(folder) or mouse2.Target.Name == 'Head' or mouse2.Target.Name == 'Torso') then
mouse1click()
end
end)
getrenv().print = function() return end
print('loaded')