Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Instant Kill for Melee Weapons (Executor Script)
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- -- Wait for tool to be equipped
- LocalPlayer.CharacterAdded:Connect(function(char)
- char.ChildAdded:Connect(function(child)
- if child:IsA("Tool") and child:FindFirstChild("Handle") then
- local handle = child:FindFirstChild("Handle")
- handle.Touched:Connect(function(hit)
- local targetChar = hit:FindFirstAncestorOfClass("Model")
- if targetChar and targetChar:FindFirstChild("Humanoid") and targetChar ~= LocalPlayer.Character then
- targetChar:FindFirstChild("Humanoid").Health = 0
- end
- end)
- end
- end)
- end)
- -- Also apply to currently held tool
- if LocalPlayer.Character then
- for _, tool in pairs(LocalPlayer.Character:GetChildren()) do
- if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
- local handle = tool:FindFirstChild("Handle")
- handle.Touched:Connect(function(hit)
- local targetChar = hit:FindFirstAncestorOfClass("Model")
- if targetChar and targetChar:FindFirstChild("Humanoid") and targetChar ~= LocalPlayer.Character then
- targetChar:FindFirstChild("Humanoid").Health = 0
- end
- end)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement