Kill aura test

public
vxpreen Jul 31, 2024 Never 42
Clone
Lua paste1.txt 165 lines (144 loc) | 5.89 KB
1
-- loadstring(game:HttpGet("https://pastecode.dev/raw/e5v3ah8a/paste1.txt"))()
2
local Players = game:GetService("Players")
3
local LocalPlayer = Players.LocalPlayer
4
local RunService = game:GetService("RunService")
5
local UserInputService = game:GetService("UserInputService")
6
7
local Killaura = {Enabled = true}
8
local KillauraRange = 6
9
local KillauraAngle = 360
10
local KillauraTarget = {Enabled = false}
11
local KillauraRangeCirclePart
12
local dmgEnabled = true
13
14
-- HoleOff variable and its initial state
15
_G.HoleOff = true -- Set this to false if you want the "hole" to be active initially
16
17
-- Initial Load Notification
18
game.StarterGui:SetCore("SendNotification", {
19
Title = "Loaded!";
20
Text = "Killaura/reach";
21
})
22
23
-- Hole Notification
24
game.StarterGui:SetCore("SendNotification", {
25
Title = "Hole";
26
Text = _G.HoleOff and "On" or "Off";
27
})
28
29
local function createRangeVisualizer()
30
local part = Instance.new("Part")
31
part.Shape = Enum.PartType.Ball
32
part.Size = Vector3.new(KillauraRange * 2, KillauraRange * 2, KillauraRange * 2)
33
part.Anchored = true
34
part.CanCollide = false
35
part.Transparency = 0.7
36
part.Material = Enum.Material.Neon
37
part.Color = Color3.fromRGB(138, 33, 32)
38
return part
39
end
40
41
local function onHit(hit, handle)
42
pcall(function()
43
local sword = LocalPlayer.Character:FindFirstChildOfClass("Tool") and LocalPlayer.Character:FindFirstChildOfClass("Tool").Handle
44
for _, v in pairs(Players:GetPlayers()) do
45
if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("Left Arm") then
46
if (LocalPlayer.Character.Torso.Position - v.Character.Torso.Position).Magnitude <= _G.Reach then
47
local rightLeg = v.Character:FindFirstChild("Right Leg")
48
if rightLeg then
49
rightLeg:BreakJoints()
50
rightLeg.Transparency = 1
51
rightLeg.CanCollide = false
52
rightLeg.CFrame = LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(1, 0, -3.5)
53
end
54
end
55
end
56
end
57
end)
58
end
59
60
local function getToolHandle()
61
local character = LocalPlayer.Character
62
if character then
63
local tool = character:FindFirstChildWhichIsA("Tool")
64
if tool then
65
return tool:FindFirstChildWhichIsA("BasePart")
66
end
67
end
68
return nil
69
end
70
71
local function attackNearbyPlayers()
72
if not Killaura.Enabled then return end
73
74
local character = LocalPlayer.Character
75
if not character then return end
76
77
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
78
if not humanoidRootPart then return end
79
80
local handle = getToolHandle()
81
if not handle then return end
82
83
for _, player in pairs(Players:GetPlayers()) do
84
if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
85
local targetRootPart = player.Character.HumanoidRootPart
86
local distance = (humanoidRootPart.Position - targetRootPart.Position).Magnitude
87
88
-- Calculate the angle between the player's look direction and the target
89
local angle = math.deg(math.acos(humanoidRootPart.CFrame.lookVector:Dot((targetRootPart.Position - humanoidRootPart.Position).Unit)))
90
91
-- Logic for reach and hole
92
if _G.HoleOff then
93
if distance <= KillauraRange and angle <= (KillauraAngle / 2) and targetRootPart.Position.Y >= humanoidRootPart.Position.Y - 0.1 then
94
onHit(targetRootPart, handle)
95
end
96
else
97
if distance <= KillauraRange and angle <= (KillauraAngle / 2) then
98
onHit(targetRootPart, handle)
99
end
100
end
101
end
102
end
103
end
104
105
local function toggleKillaura()
106
Killaura.Enabled = not Killaura.Enabled
107
end
108
109
local function toggleVisualizer()
110
if KillauraRangeCirclePart then
111
KillauraRangeCirclePart:Destroy()
112
KillauraRangeCirclePart = nil
113
else
114
KillauraRangeCirclePart = createRangeVisualizer()
115
KillauraRangeCirclePart.Parent = workspace
116
end
117
end
118
119
local function toggleHole()
120
_G.HoleOff = not _G.HoleOff
121
game.StarterGui:SetCore("SendNotification", {
122
Title = "Hole";
123
Text = _G.HoleOff and "On" or "Off";
124
})
125
end
126
127
UserInputService.InputBegan:Connect(function(input, gameProcessed)
128
if gameProcessed then return end
129
130
if input.KeyCode == Enum.KeyCode.J then
131
toggleKillaura()
132
elseif input.KeyCode == Enum.KeyCode.U then
133
toggleVisualizer()
134
elseif input.KeyCode == Enum.KeyCode.H then -- Toggle Hole with 'H' key
135
toggleHole()
136
elseif input.KeyCode == Enum.KeyCode.R then
137
KillauraRange = KillauraRange + 0.5
138
-- Ensure notification appears only once
139
game.StarterGui:SetCore("SendNotification", {
140
Title = "Reach Adjustment";
141
Text = "Increased to " .. KillauraRange;
142
})
143
elseif input.KeyCode == Enum.KeyCode.E then
144
KillauraRange = KillauraRange - 0.5
145
-- Ensure notification appears only once
146
game.StarterGui:SetCore("SendNotification", {
147
Title = "Reach Adjustment";
148
Text = "Decreased to " .. KillauraRange;
149
})
150
end
151
end)
152
153
RunService.Heartbeat:Connect(function()
154
if Killaura.Enabled then
155
attackNearbyPlayers()
156
157
if KillauraRangeCirclePart then
158
local character = LocalPlayer.Character
159
if character and character:FindFirstChild("HumanoidRootPart") then
160
KillauraRangeCirclePart.Position = character.HumanoidRootPart.Position
161
KillauraRangeCirclePart.Size = Vector3.new(KillauraRange * 2, KillauraRange * 2, KillauraRange * 2)
162
end
163
end
164
end
165
end)