Roblox Reach Player Target 2

public
vxpreen Jun 16, 2024 Never 59
Clone
Lua paste1.lua 332 lines (304 loc) | 12.4 KB
1
-- loadstring(game:HttpGet("https://pastecode.dev/raw/9crad52f/paste1.lua"))() or
2
3
-- H to hide, U to toggle visualize, Y to toggle no dmg underneath your character
4
5
local active = true
6
local trueActive = true
7
local reachType = "Sphere"
8
local target = "Others" -- Default target
9
local visualizerEnabled = false
10
local onHitToggle = false -- State variable for onHit function behavior
11
12
local visualizer = Instance.new("Part")
13
visualizer.BrickColor = BrickColor.Blue()
14
visualizer.Transparency = 0.6
15
visualizer.Anchored = true
16
visualizer.CanCollide = false
17
visualizer.Size = Vector3.new(0.5,0.5,0.5)
18
visualizer.BottomSurface = Enum.SurfaceType.Smooth
19
visualizer.TopSurface = Enum.SurfaceType.Smooth
20
21
local ScreenGui = Instance.new("ScreenGui")
22
local Frame = Instance.new("Frame")
23
local TextLabel = Instance.new("TextLabel")
24
local TextBox = Instance.new("TextBox")
25
local TextLabel_2 = Instance.new("TextLabel")
26
local TextLabel_3 = Instance.new("TextLabel")
27
local TextLabel_4 = Instance.new("TextLabel")
28
local TextButton = Instance.new("TextButton")
29
local Frame_2 = Instance.new("Frame")
30
local Frame_3 = Instance.new("Frame")
31
local Frame_4 = Instance.new("Frame")
32
local Frame_5 = Instance.new("Frame")
33
local TextButton_2 = Instance.new("TextButton")
34
35
--Properties:
36
37
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
38
ScreenGui.DisplayOrder = 999999999
39
ScreenGui.ResetOnSpawn = false
40
41
Frame.Parent = ScreenGui
42
Frame.AnchorPoint = Vector2.new(0, 0.5)
43
Frame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
44
Frame.BackgroundTransparency = 0.300
45
Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
46
Frame.BorderSizePixel = 4
47
Frame.Position = UDim2.new(0, 0, 0.600000024, 0)
48
Frame.Size = UDim2.new(0.150000006, 0, 0.300000012, 0)
49
50
TextLabel.Parent = Frame
51
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
52
TextLabel.BackgroundTransparency = 1.000
53
TextLabel.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
54
TextLabel.Font = Enum.Font.SourceSans
55
TextLabel.Text = "Reach:"
56
TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
57
TextLabel.TextScaled = true
58
TextLabel.TextSize = 14.000
59
TextLabel.TextWrapped = true
60
61
TextBox.Parent = Frame
62
TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
63
TextBox.BackgroundTransparency = 1.000
64
TextBox.Position = UDim2.new(0.600000024, 0, 0, 0)
65
TextBox.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
66
TextBox.Font = Enum.Font.SourceSans
67
TextBox.Text = "3.5"
68
TextBox.TextColor3 = Color3.fromRGB(255, 76, 76)
69
TextBox.TextScaled = true
70
TextBox.TextSize = 14.000
71
TextBox.TextWrapped = true
72
73
TextLabel_2.Parent = Frame
74
TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
75
TextLabel_2.BackgroundTransparency = 1.000
76
TextLabel_2.Position = UDim2.new(0, 0, 0.200000003, 0)
77
TextLabel_2.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
78
TextLabel_2.Font = Enum.Font.SourceSans
79
TextLabel_2.Text = "Shape:"
80
TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
81
TextLabel_2.TextScaled = true
82
TextLabel_2.TextSize = 14.000
83
TextLabel_2.TextWrapped = true
84
85
TextLabel_3.Parent = Frame
86
TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
87
TextLabel_3.BackgroundTransparency = 1.000
88
TextLabel_3.Position = UDim2.new(0, 0, 0.400000006, 0)
89
TextLabel_3.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
90
TextLabel_3.Font = Enum.Font.SourceSans
91
TextLabel_3.Text = "Target:"
92
TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
93
TextLabel_3.TextScaled = true
94
TextLabel_3.TextSize = 14.000
95
TextLabel_3.TextWrapped = true
96
97
TextLabel_4.Parent = Frame
98
TextLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
99
TextLabel_4.BackgroundTransparency = 1.000
100
TextLabel_4.Position = UDim2.new(0, 0, 0.600000024, 0)
101
TextLabel_4.Size = UDim2.new(0.600000024, 0, 0.200000003, 0)
102
TextLabel_4.Font = Enum.Font.SourceSans
103
TextLabel_4.Text = "Visualizer:"
104
TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
105
TextLabel_4.TextScaled = true
106
TextLabel_4.TextSize = 14.000
107
TextLabel_4.TextWrapped = true
108
109
TextButton.Parent = Frame
110
TextButton.AnchorPoint = Vector2.new(0, 1)
111
TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
112
TextButton.BackgroundTransparency = 1.000
113
TextButton.Position = UDim2.new(0, 0, 1, 0)
114
TextButton.Size = UDim2.new(1, 0, 0.150000006, 0)
115
TextButton.Font = Enum.Font.SourceSansBold
116
TextButton.Text = "Kill Script"
117
TextButton.TextColor3 = Color3.fromRGB(222, 0, 0)
118
TextButton.TextScaled = true
119
TextButton.TextSize = 14.000
120
TextButton.TextWrapped = true
121
122
Frame_2.Parent = Frame
123
Frame_2.Active = true
124
Frame_2.AnchorPoint = Vector2.new(0, 0.5)
125
Frame_2.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
126
Frame_2.BorderSizePixel = 0
127
Frame_2.Position = UDim2.new(0.725000024, 0, 0.699999988, 0)
128
Frame_2.Size = UDim2.new(0, 25, 0, 25)
129
Frame_2.ZIndex = 5
130
131
Frame_3.Parent = Frame_2
132
Frame_3.AnchorPoint = Vector2.new(0.5, 0.5)
133
Frame_3.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
134
Frame_3.BorderSizePixel = 0
135
Frame_3.LayoutOrder = 1
136
Frame_3.Position = UDim2.new(0.5, 0, 0.5, 0)
137
138
Frame_4.Parent = Frame
139
Frame_4.Active = true
140
Frame_4.AnchorPoint = Vector2.new(0, 0.5)
141
Frame_4.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
142
Frame_4.BorderSizePixel = 0
143
Frame_4.Position = UDim2.new(9999999, 99999999, 9999, 999999)
144
Frame_4.Size = UDim2.new(0, 25, 0, 25)
145
Frame_4.ZIndex = 5
146
147
Frame_5.Parent = Frame_4
148
Frame_5.AnchorPoint = Vector2.new(0.5, 0.5)
149
Frame_5.BackgroundColor3 = Color3.fromRGB(255, 76, 76)
150
Frame_5.BorderSizePixel = 0
151
Frame_5.LayoutOrder = 1
152
Frame_5.Position = UDim2.new(0.5, 0, 0.5, 0)
153
Frame_5.Size = UDim2.new(1, 0, 1, 0)
154
155
TextButton_2.Parent = Frame
156
TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
157
TextButton_2.BackgroundTransparency = 1.000
158
TextButton_2.Position = UDim2.new(0.600000024, 0, 0.200000003, 0)
159
TextButton_2.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
160
TextButton_2.Font = Enum.Font.SourceSans
161
TextButton_2.Text = "Sphere"
162
TextButton_2.TextColor3 = Color3.fromRGB(255, 76, 76)
163
TextButton_2.TextScaled = true
164
TextButton_2.TextSize = 14.000
165
TextButton_2.TextWrapped = true
166
167
-- Add a TextBox for Target input
168
local TargetTextBox = Instance.new("TextBox")
169
TargetTextBox.Parent = Frame
170
TargetTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
171
TargetTextBox.BackgroundTransparency = 1.000
172
TargetTextBox.Position = UDim2.new(0.600000024, 0, 0.400000006, 0)
173
TargetTextBox.Size = UDim2.new(0.400000006, 0, 0.200000003, 0)
174
TargetTextBox.Font = Enum.Font.SourceSans
175
TargetTextBox.Text = "Others" -- Default text
176
TargetTextBox.TextColor3 = Color3.fromRGB(255, 76, 76)
177
TargetTextBox.TextScaled = true
178
TargetTextBox.TextSize = 14.000
179
TargetTextBox.TextWrapped = true
180
181
-- Modify the TargetTextBox.FocusLost event to handle target selection
182
TargetTextBox.FocusLost:Connect(function(enterPressed)
183
local input = TargetTextBox.Text
184
if input:lower() == "others" then
185
target = "Others"
186
else
187
-- Check if the input matches any player's name partially or fully
188
for _, player in pairs(game.Players:GetPlayers()) do
189
if input:lower() == "others" or player.Name:lower():find(input:lower(), 1, true) then
190
target = player.Name
191
break
192
end
193
end
194
end
195
end)
196
197
-- Update the onHit function to consider the specified target
198
local function onHit(hit, handle)
199
local victim = hit.Parent:FindFirstChildOfClass("Humanoid")
200
if victim then
201
if target == "Others" or (victim.Parent.Name == target and victim.Parent.Name ~= game.Players.LocalPlayer.Name) then
202
local hrp = game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
203
if hrp then
204
local hitPos = hit.Position
205
local hrpPos = hrp.Position
206
local yOffset = -0.1 -- Adjust this value as needed to avoid hitting players directly below you
207
208
if onHitToggle then
209
if hitPos.Y >= hrpPos.Y + yOffset then
210
for _, v in pairs(hit.Parent:GetChildren()) do
211
if v:IsA("Part") then
212
firetouchinterest(v, handle, 0)
213
firetouchinterest(v, handle, 1)
214
end
215
end
216
end
217
else
218
for _, v in pairs(hit.Parent:GetChildren()) do
219
if v:IsA("Part") then
220
firetouchinterest(v, handle, 0)
221
firetouchinterest(v, handle, 1)
222
end
223
end
224
end
225
end
226
end
227
end
228
end
229
230
repeat wait() until game.Players.LocalPlayer
231
ScreenGui.Parent = game:GetService("CoreGui")
232
233
Frame_4.InputBegan:connect(function(inp)
234
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
235
visualizerEnabled = not visualizerEnabled
236
local goal = {Size = UDim2.new(0,0,0,0)}
237
if visualizerEnabled then
238
goal = {Size = UDim2.new(1,0,1,0)}
239
end
240
game:GetService("TweenService"):Create(Frame_3,TweenInfo.new(0.12,Enum.EasingStyle.Linear),goal):Play()
241
end
242
end)
243
TextButton_2.MouseButton1Click:connect(function()
244
if reachType == "Sphere" then
245
reachType = "Line"
246
else
247
reachType = "Sphere"
248
end
249
TextButton_2.Text = reachType
250
end)
251
TextButton.MouseButton1Click:connect(function()
252
trueActive = false
253
ScreenGui:Destroy()
254
end)
255
256
-- Toggle visualizer with "U" key
257
game:GetService("UserInputService").InputBegan:connect(function(inp,gpe)
258
if gpe then return end
259
if inp.KeyCode == Enum.KeyCode.H then
260
ScreenGui.Enabled = not ScreenGui.Enabled
261
elseif inp.KeyCode == Enum.KeyCode.U then
262
visualizerEnabled = not visualizerEnabled
263
elseif inp.KeyCode == Enum.KeyCode.Y then
264
onHitToggle = not onHitToggle
265
end
266
end)
267
268
local plr = game.Players.LocalPlayer
269
270
local function getWhiteList()
271
local wl = {}
272
for _,v in pairs(game.Players:GetPlayers()) do
273
if v ~= plr then
274
local char = v.Character
275
if char then
276
for _,q in pairs(char:GetChildren()) do
277
if q:IsA("Part") then
278
table.insert(wl,q)
279
end
280
end
281
end
282
end
283
end
284
return wl
285
end
286
287
game:GetService("RunService").RenderStepped:connect(function()
288
if not active or not trueActive then return end
289
local s = plr.Character and plr.Character:FindFirstChildOfClass("Tool")
290
if not s then visualizer.Parent = nil end
291
if s then
292
local handle = s:FindFirstChild("Handle") or s:FindFirstChildOfClass("Part")
293
if handle then
294
if visualizerEnabled then
295
visualizer.Parent = workspace
296
else
297
visualizer.Parent = nil
298
end
299
local reach = tonumber(TextBox.Text)
300
if reach then
301
if reachType == "Sphere" then
302
visualizer.Shape = Enum.PartType.Ball
303
visualizer.Size = Vector3.new(reach,reach,reach)
304
visualizer.CFrame = handle.CFrame
305
for _,v in pairs(game.Players:GetPlayers()) do
306
local hrp = v.Character and v.Character:FindFirstChild("HumanoidRootPart")
307
if hrp and handle then
308
local mag = (hrp.Position-handle.Position).magnitude
309
if mag <= reach then
310
onHit(hrp,handle)
311
end
312
end
313
end
314
elseif reachType == "Line" then
315
local origin = (handle.CFrame*CFrame.new(0,0,-2)).p
316
local ray = Ray.new(origin,handle.CFrame.lookVector*-reach)
317
local p,pos = workspace:FindPartOnRayWithWhitelist(ray,getWhiteList())
318
visualizer.Shape = Enum.PartType.Block
319
visualizer.Size = Vector3.new(1,0.8,reach)
320
visualizer.CFrame = handle.CFrame*CFrame.new(0,0,(reach/2)+2)
321
if p then
322
onHit(p,handle)
323
else
324
for _,v in pairs(handle:GetTouchingParts()) do
325
onHit(v,handle)
326
end
327
end
328
end
329
end
330
end
331
end
332
end)