Hey all,
I've got a persistent error I just can't get to the bottom of. I'm running a script in a model to try and get it to disappear (and not be harvestable) when it's reduced to 0 HP. I keep getting a first child error on the second line and can't resolve it by shifting the hierarchy around. Any ideals?
local Object = script.Parent local HP = Object:findfirstchild(HP) local MaxHP = Object:findfirstchild(MaxHP) local Model = Object:findfirstchild(Model) local CanHarvest = Object:findfirstchild(Model)
if HP == 0 then Model.Transparency = 1 Model.CanCollide = false canHarvest.Value = true wait(5) canHarvest.Value = true partTouched.Transparency = 0 partTouched.CanCollide = true HP.Value = MaxHP.Value
end

1 comment
It's
FindFirstChild(). Note the capitalization.