Hello, how can I make it when I punch Tool.Activated
or when the PunchGetDamageEvent
has been activated anyways I got the tool and handle variable. How would I get the humanoid from the handle touch?
So not me, the one who gets damaged when I punch. I want the enemy because now when I activate the tool, Im the one who gets damaged.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PunchGetDamageEvent = ReplicatedStorage.RemoteEvents.PunchGetDamage
local PunchSoundEvent = ReplicatedStorage.RemoteEvents.PunchSound
local Enable = false
PunchGetDamageEvent.OnServerEvent:Connect(function(player)
if Enable == false then
Enable = true
local Tool = player.Character:WaitForChild("Boxer") or player.Backpack:WaitForChild("Boxer")
local Handle = Tool.Handle
local humanoid = player.Character.Humanoid
local damage = 1
if humanoid.Health > 0 then
humanoid:TakeDamage(damage)
PunchSoundEvent:FireAllClients()
wait(0.5)
Enable = false
end
end
end)