Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
oSyM8V3N 429 Moderation Voter
6 years ago
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.

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 killzebra312 -7 — 6y

1 answer

Log in to vote
-1
Answered by 6 years ago

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 )
Ad

Answer this question