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

Whats rong with this kill script?

Asked by 9 years ago

name = "Humanoid" function OnTouched(hit) i = 0 Humanoid = hit.Parent:FindfirstChild("Humanoid") if Humanoid then hit.Parent:FindFirstChild("Humanod").Health = i end end

script.Parent.Touched:connect(OnTouched)

0
In future, can you put your code into the code block.. Makes it easier to read Uroxus 350 — 9y
0
The output should have told you your spelling mistake, look there as well in future Mystdar 352 — 9y

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
9 years ago

You spelled Humanoid wrong after the if statement ('Humanod'):

function onTouched(hit)
    local i = 0
    local humanoid = hit.Parent:FindFirstChild("Humanoid")

    if humanoid then
        humanoid.Health = 0
    end
end

script.Parent.Touched:connect(onTouched)
Ad

Answer this question