Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come this Damage script doesn't work with R15 Characters?

debounce = false

function hit (h) 
    if h.Parent:findFirstChild("Humanoid") and debounce == false then
	debounce = true
            h.Parent.Humanoid.Health =  h.Parent.Humanoid.Health  - 5
print("You have damaged: ".. h.Parent.Name)
        end 
end
script.Parent.Touched:connect(hit) 

I heard R15 has a problem with collisions, but I've seen other game's work with it perfectly. Does anyone has a solution to it? Btw, It doesn't work OR print at all.

1 comment

0

i think you forgot to write debounce = false after the other things in the function.... i'm not sure it will fix the script but it's still a big problem

1 answer

I tried this script out and it works, Go ahead.

function onTouched( hit )
	hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 5
end

script.Parent.Touched:connect( onTouched )

This discussion is preserved as it was. New answers, comments, and votes are closed.