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

Help with function?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago
Text = "Test"

script.Parent.Touched:connect(function(Player)
    Player.FindFirstChild("Humanoid")
    Humanoid.Health = 0
print(Text)

1 answer

Log in to vote
1
Answered by 8 years ago

Okay, when you fire a Touched function in a part, it finds the PART, not MODEL PARENT.

Text = "Test"

script.Parent.Touched:connect(function(Player)
hum=    Player.Parent:FindFirstChild("Humanoid")
    hum.Health = 0
print(Text)
end)
Ad

Answer this question