I have a part inside of a model welded and inside of a starter character, and inside workspace, I have a damage script that's supposed to make the part deal damage. The problem is, it doesn't work. The part definately is touching other players, but it isn't dealing any damage. Here's the script.
local debounce = false
local dmg = 27
function OnTouched(hit)
if hit.StarterPlayer.StarterCharacter.saberlight.blade ~= nil then
if debounce == false and hit.StarterPlayer.StarterCharacter.saberlight.blade:findFirstChild("Humanoid") ~= nil then
debounce = true
hit.StarterPlayer.StarterCharacter.saberlight.blade:findFirstChild("Humanoid"):TakeDamage(dmg)
wait(1.2)
debounce = false
end
end
end
script.Parent.Parent.StarterCharacter.saberlight.blade.Touched:connect(OnTouched)

4 comments
yes, it didn't print "humanoid found" in the output
But I did get an output that wrote script'Workspace.MyUsername.dmg1local', Line 20
Can you tell me how you would go about doing this?
No I don't actually. I will try to understand but can't today I'm sorry, I might try tomorrow