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

Workspace.SCP-075.SCP.Part.Script:4: attempt to index nil with 'Health' server script help?

Asked by 2 years ago

function onTouched(part) local h = part.Parent:findFirstChild("Humanoid")

h.Health = h.Health -25
        wait(2)
h.Health = h.Health -5

end

script.Parent.Touched:connect(onTouched)

0
?? what are you trying to do please explain theking66hayday 841 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Read this before you post: https://scriptinghelpers.org/help/community-guidelines right now it's a little hard to understand what is going on here

now I don't know if "-25" is an actual way to subtract a value but I'm assuming it isn't. See if that works.


h.Health = h.Health - 25 wait(2) h.Health = h.Health - 5

If not lmk

Ad

Answer this question