1 | |
2 | |
3 | local player = game:GetService("Players").LocalPlayer |
4 | local range = 25 |
5 | |
6 | |
7 | game:GetService("RunService").RenderStepped:Connect(function() |
8 | local players = game.Players:GetPlayers() |
9 | for i = 2, #players do |
10 | local otherPlayer = players[i] |
11 | local character = otherPlayer.Character |
12 | if character and character:FindFirstChild("Humanoid") and character.Humanoid.Health > 0 and character:FindFirstChild("HumanoidRootPart") then |
13 | if player:DistanceFromCharacter(character.HumanoidRootPart.Position) <= range then |
14 | local tool = player.Character and player.Character:FindFirstChildOfClass("Tool") |
15 | if tool and tool:FindFirstChild("Handle") then |
16 | tool:Activate() |
17 | |
18 | end |
19 | end |
20 | end |
21 | end |
22 | end) |