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

Cannot find Humanoid even though Humanoid exists?

Asked by 5 years ago
Edited 5 years ago
handle.Touched:connect(function(hit)
            if Mouse.Button1Down then
                        while true do
                            wait(0.1)
                            if hit.Parent:WaitForChild("Humanoid",1) then
                                hit.Parent:WaitForChild("Humanoid",1):TakeDamage(100)
                                print("Success!")
                            else
                                print("Something happened.")
                            end
                        end
                    end
                end)

The script keeps saying that "Humanoid" is a nil value, even though it exists in the target. What do I do to fix this?

0
what is that mouse.button1down for? Imperialy 149 — 5y
0
dont think those can be used in serverscripts? Imperialy 149 — 5y
0
this is a LocalScript? yHasteeD 1819 — 5y
0
Yes, this is a LocalScript. It's a script for a sword. Starflyerz 44 — 5y
0
You need to put this in a server script due to Filtering Enabled, I think. JayzYeah32 62 — 5y

Answer this question