1 | |
2 | |
3 | local Players = game:GetService("Players") |
4 | local LocalPlayer = Players.LocalPlayer |
5 | local RunService = game:GetService("RunService") |
6 | local UserInputService = game:GetService("UserInputService") |
7 | |
8 | local Killaura = {Enabled = true} |
9 | local KillauraRange = 6 |
10 | local KillauraAngle = 360 |
11 | local KillauraTarget = {Enabled = false} |
12 | local KillauraRangeCirclePart |
13 | local dmgEnabled = true |
14 | |
15 | _G.HoleOff = false |
16 | |
17 | game.StarterGui:SetCore("SendNotification", { |
18 | Title = "Loaded!"; |
19 | Text = "Killaura/reach"; |
20 | }) |
21 | |
22 | game.StarterGui:SetCore("SendNotification", { |
23 | Title = "Hits En Hole"; |
24 | Text = _G.HoleOff and "Off" or "On"; |
25 | }) |
26 | |
27 | local function createRangeVisualizer() |
28 | local part = Instance.new("Part") |
29 | part.Shape = Enum.PartType.Ball |
30 | part.Size = Vector3.new(KillauraRange * 2, KillauraRange * 2, KillauraRange * 2) |
31 | part.Anchored = true |
32 | part.CanCollide = false |
33 | part.Transparency = 0.7 |
34 | part.Material = Enum.Material.Neon |
35 | part.Color = Color3.fromRGB(138, 33, 32) |
36 | return part |
37 | end |
38 | |
39 | local function onHit(hit, handle) |
40 | local victim = hit.Parent:FindFirstChildOfClass("Humanoid") |
41 | if victim and victim.Parent.Name ~= LocalPlayer.Name then |
42 | if dmgEnabled then |
43 | for _, v in pairs(hit.Parent:GetChildren()) do |
44 | if v:IsA("BasePart") then |
45 | firetouchinterest(handle, v, 0) |
46 | firetouchinterest(handle, v, 1) |
47 | end |
48 | end |
49 | else |
50 | firetouchinterest(handle, hit, 0) |
51 | firetouchinterest(handle, hit, 1) |
52 | end |
53 | end |
54 | end |
55 | |
56 | local function getToolHandle() |
57 | local character = LocalPlayer.Character |
58 | if character then |
59 | local tool = character:FindFirstChildWhichIsA("Tool") |
60 | if tool then |
61 | return tool:FindFirstChildWhichIsA("BasePart") |
62 | end |
63 | end |
64 | return nil |
65 | end |
66 | |
67 | local function attackNearbyPlayers() |
68 | if not Killaura.Enabled then return end |
69 | |
70 | local character = LocalPlayer.Character |
71 | if not character then return end |
72 | |
73 | local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") |
74 | if not humanoidRootPart then return end |
75 | |
76 | local handle = getToolHandle() |
77 | if not handle then return end |
78 | |
79 | for _, player in pairs(Players:GetPlayers()) do |
80 | if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then |
81 | local targetRootPart = player.Character.HumanoidRootPart |
82 | local distance = (humanoidRootPart.Position - targetRootPart.Position).Magnitude |
83 | |
84 | local isWithinReach = distance <= KillauraRange |
85 | local isNotUnderCharacter = targetRootPart.Position.Y >= humanoidRootPart.Position.Y - 0.1 |
86 | |
87 | if _G.HoleOff then |
88 | if isWithinReach and isNotUnderCharacter then |
89 | onHit(targetRootPart, handle) |
90 | end |
91 | else |
92 | if isWithinReach then |
93 | onHit(targetRootPart, handle) |
94 | end |
95 | end |
96 | end |
97 | end |
98 | end |
99 | |
100 | local function toggleKillaura() |
101 | Killaura.Enabled = not Killaura.Enabled |
102 | end |
103 | |
104 | local function toggleVisualizer() |
105 | if KillauraRangeCirclePart then |
106 | KillauraRangeCirclePart:Destroy() |
107 | KillauraRangeCirclePart = nil |
108 | else |
109 | KillauraRangeCirclePart = createRangeVisualizer() |
110 | KillauraRangeCirclePart.Parent = workspace |
111 | end |
112 | end |
113 | |
114 | local function toggleHole() |
115 | _G.HoleOff = not _G.HoleOff |
116 | game.StarterGui:SetCore("SendNotification", { |
117 | Title = "Hits En Hole"; |
118 | Text = _G.HoleOff and "Off" or "On"; |
119 | }) |
120 | end |
121 | |
122 | UserInputService.InputBegan:Connect(function(input, gameProcessed) |
123 | if gameProcessed then return end |
124 | |
125 | if input.KeyCode == Enum.KeyCode.J then |
126 | toggleKillaura() |
127 | elseif input.KeyCode == Enum.KeyCode.U then |
128 | toggleVisualizer() |
129 | elseif input.KeyCode == Enum.KeyCode.H then |
130 | toggleHole() |
131 | elseif input.KeyCode == Enum.KeyCode.R then |
132 | KillauraRange = KillauraRange + 0.5 |
133 | |
134 | game.StarterGui:SetCore("SendNotification", { |
135 | Title = "Reach"; |
136 | Text = "" .. KillauraRange; |
137 | }) |
138 | elseif input.KeyCode == Enum.KeyCode.E then |
139 | KillauraRange = KillauraRange - 0.5 |
140 | |
141 | game.StarterGui:SetCore("SendNotification", { |
142 | Title = "Reach"; |
143 | Text = "" .. KillauraRange; |
144 | }) |
145 | end |
146 | end) |
147 | |
148 | RunService.Heartbeat:Connect(function() |
149 | if Killaura.Enabled then |
150 | attackNearbyPlayers() |
151 | |
152 | if KillauraRangeCirclePart then |
153 | local character = LocalPlayer.Character |
154 | if character and character:FindFirstChild("HumanoidRootPart") then |
155 | KillauraRangeCirclePart.Position = character.HumanoidRootPart.Position |
156 | KillauraRangeCirclePart.Size = Vector3.new(KillauraRange * 2, KillauraRange * 2, KillauraRange * 2) |
157 | end |
158 | end |
159 | end |
160 | end) |