im new to events and i was able to understand the basics. im making a combat game. in the video shown here, the arms is touching the dummy but for some reason it isnt registering in certain posistions and places. is it a bug? ill just send the code that actually matters.
local punchevent = script.Parent.Punch
local debounce = true
punchevent.OnServerEvent:Connect(function(players, nameofpl, valuetype)
local eventfiredfinish = false
if valuetype == "punchl" then
print("Some bozo punched but ok")
local arm = nameofpl:FindFirstChild("Left Arm")
if arm == nil then
warn("Error, cannot find arm for some reason")
else
arm.Touched:Connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if not human then return end
if human and debounce and not eventfiredfinish then
debounce = false
human:TakeDamage(8)
print("hit")
task.wait(0.08)
debounce = true
end
end)
end
task.wait(0.1)
eventfiredfinish = true