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

Why is this not working?

Asked by 10 years ago
local humanoid = script.Parent:FindFirstChild("Humanoi­d")
function onTouched(hit)--

if hit.Parent.Name == "Tree" then
    hit.Parent.health.Value = hit.Parent.health.Value - 1

    if hit.Parent.health.Value == 1< then
        humanoid.Health = 0 -- damage the humanoid
end
end

connection = script.Parent.Touched:connect(onTouched)

Im getting an error on line 5 expected identifier, got 'then' its got the little red line under 'then' no idea why however

Answer this question