-
Notifications
You must be signed in to change notification settings - Fork 0
/
Esp
198 lines (194 loc) · 6.15 KB
/
Esp
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
local lPlayer = game.Players.LocalPlayer;
local lTeam = lPlayer.TeamColor;
local mode = 1;
local speed = .7; -- CFrame interpolation every second.
local aimToggle = false;
local enemyColor = BrickColor.Red();
local friendlyColor = BrickColor.Blue();
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.RightAlt then
if aimToggle == false then
--aimToggle = true;
else
--aimToggle = false;
end
end
if inputObject.KeyCode == Enum.KeyCode.RightControl then
if mode == 1 then
mode = 0;
for i,v in pairs(game.Players:GetChildren()) do
if v ~= lPlayer then
if game.Workspace:FindFirstChild(v.Name) ~= nil then
if v.Character:FindFirstChild("Torso") ~= nil then
v.Character.Torso.eP.Frame.Visible = false;
end
for t,x in pairs(v.Character:GetChildren()) do
if x.ClassName == "Part" then
if v.Character:FindFirstChild("Head") ~= nil then
if v.Character.Head:FindFirstChild("1") ~= nil then
for l=1,6 do
x:FindFirstChild(l).Frame.Visible = true;
end
end
end
end
end
end
end
end
elseif mode == 0 then
mode = 1;
for i,v in pairs(game.Players:GetChildren()) do
if v ~= lPlayer then
if game.Workspace:FindFirstChild(v.Name) ~= nil then
if v.Character:FindFirstChild("Torso") ~= nil then
v.Character.Torso.eP.Frame.Visible = true;
end
for t,x in pairs(v.Character:GetChildren()) do
if x.ClassName == "Part" then
if v.Character:FindFirstChild("Head") ~= nil then
if v.Character.Head:FindFirstChild("1") ~= nil then
for l=1,6 do
x:FindFirstChild(l).Frame.Visible = false;
end
end
end
end
end
end
end
end
end
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
local function ClosestPlayer(point)
local OnTarget = false;
local CurDis = nil;
local CurPlayer = nil;
for i,v in pairs(game.Players:GetChildren()) do
if v ~= lPlayer then
if CurDis == nil then
CurDis = v:DistanceFromCharacter(lPlayer.Character.Torso.Position);
CurPlayer = v;
else
if v:DistanceFromCharacter(lPlayer.Character.Torso.Position) < CurDis then
CurDis = v:DistanceFromCharacter(lPlayer.Character.Torso.Position);
CurPlayer = v;
end
end
end
end
while aimToggle == true do
for i = 0, 1, .01 do
game.Workspace.CurrentCamera.CFrame = CFrame.new(Vector3.new(game.Workspace.CurrentCamera.CFrame.X,game.Workspace.CurrentCamera.CFrame.Y,game.Workspace.CurrentCamera.CFrame.Z), CurPlayer.Character.Torso.Position);
end
end
end
while true do
for i,v in pairs(game.Players:GetChildren()) do
local vChar = game.Workspace:WaitForChild(v.Name);
if vChar.Torso:FindFirstChild("eP") == nil and v ~= lPlayer then
local fLayer = Instance.new("BillboardGui");
fLayer.Name = "eP";
fLayer.Size = UDim2.new(8,0,8,0);
fLayer.SizeOffset = Vector2.new(.5,-.55);
fLayer.LightInfluence = 0;
fLayer.AlwaysOnTop = true;
fLayer.Adornee = vChar:WaitForChild("Torso");
fLayer.Parent = vChar.Torso;
local sLayer = Instance.new("Frame");
sLayer.BackgroundTransparency = .5;
sLayer.AnchorPoint = Vector2.new(.5,.5);
if v.TeamColor == lTeam then
sLayer.BackgroundColor = BrickColor.Blue();
else
sLayer.BackgroundColor = BrickColor.Red();
end
sLayer.BorderSizePixel = 0;
sLayer.Size = UDim2.new(.5,0,.7,0);
sLayer.Parent = fLayer;
if mode == 0 then
sLayer.Visible = false;
end
local fhLayer = Instance.new("BillboardGui");
fhLayer.Name = "ePh";
fhLayer.Size = UDim2.new(8,0,8,0);
fhLayer.SizeOffset = Vector2.new(.25,-.13);
fhLayer.LightInfluence = 0;
fhLayer.AlwaysOnTop = true;
fhLayer.Adornee = vChar:WaitForChild("Torso");
fhLayer.Parent = vChar.Torso;
local health = Instance.new("Frame");
health.AnchorPoint = Vector2.new(0,.5);
health.Name = "health";
health.BorderSizePixel = 0;
health.BackgroundColor3 = Color3.fromRGB(255,0,0);
health.Size = UDim2.new((v.Character.Humanoid.Health/v.Character.Humanoid.MaxHealth)/2,0,.05,0);
health.Parent = fhLayer;
local fnLayer = Instance.new("BillboardGui");
fnLayer.Name = "ePn";
fnLayer.Size = UDim2.new(8,0,8,0);
fnLayer.SizeOffset = Vector2.new(.25,0);
fnLayer.LightInfluence = 0;
fnLayer.AlwaysOnTop = true;
fnLayer.Adornee = vChar:WaitForChild("Torso");
fnLayer.Parent = vChar.Torso;
local name = Instance.new("TextLabel");
name.AnchorPoint = Vector2.new(0,.5);
name.Name = "txtlabel";
name.BorderSizePixel = 0;
name.BackgroundTransparency = 1;
name.Size = UDim2.new(.5,0,.05,0);
name.Position = UDim2.new(0,0,0,0);
name.TextScaled = true;
name.Text = v.Name;
name.TextColor3 = Color3.fromRGB(sLayer.BackgroundColor.r,sLayer.BackgroundColor.g,sLayer.BackgroundColor.b);
name.Parent = fnLayer;
for x,t in pairs(vChar:GetChildren()) do
if t.ClassName == "Part" then
for l = 1, 6 do
local headLayer = Instance.new("SurfaceGui");
headLayer.Name = l;
headLayer.LightInfluence = 0;
headLayer.AlwaysOnTop = true;
headLayer.Adornee = vChar:WaitForChild(t.Name);
headLayer.Parent = t;
if l==1 then
headLayer.Face = "Front";
elseif l==2 then
headLayer.Face = "Right";
elseif l==3 then
headLayer.Face = "Left";
elseif l==4 then
headLayer.Face = "Back";
elseif l==5 then
headLayer.Face = "Top";
elseif l==6 then
headLayer.Face = "Bottom";
end
local xLayer = Instance.new("Frame");
xLayer.BackgroundTransparency = .5;
xLayer.AnchorPoint = Vector2.new(0,0);
if v.TeamColor == lTeam then
xLayer.BackgroundColor = BrickColor.Blue();
else
xLayer.BackgroundColor = BrickColor.Red();
end
xLayer.BorderSizePixel = 0;
xLayer.Size = UDim2.new(1,0,1,0);
xLayer.Parent = headLayer;
if mode == 1 then
xLayer.Visible = false;
end
end
end
end
else
if v ~= lPlayer then
v.Character.Torso.ePh.health.Size = UDim2.new((v.Character.Humanoid.Health/v.Character.Humanoid.MaxHealth)/2,0,.05,0);
end
end
end
wait(.3);
end