In simple terms, you will need to communicate with a server script (preferrably within the tool) via a RemoteEvent, which will inflict the damage on the target’s Humanoid on the server.
I really wouldn’t reccomend doing this, as an exploiter could just spam the RemoteEvent, dealing damage to them immediately the second they get in range with them, basically ruining the entire game.
A better way would be to perhaps use Region3’s/ GetPartsInPart
Or use the default Touched method (unreliable, client can exploit but still the easiest)
local Tool = script.Parent
local MChar
local Handle = Tool:WaitForChild("Handle")
Tool.Activated:Connect(function(...)
MChar = Tool.Parent
local Got = workspace:GetPartsInPart(Handle)
for _, v in ipairs(Got) do
if v.Parent then
local Char = v.Parent
local Humanoid = Char:FindFirstChildWhichIsA("Humanoid")
if v:IsA("BasePart") and Humanoid and Humanoid.Parent ~= MChar then
Humanoid:TakeDamage(10)
break
end
end
end
end)
Untested code, but that should be a good example.
Edit: Used a stupid method to prevent self damage, look into OverlapParams to get a better fix than what I did : /