Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't this BoolValue change?

I have one script that when a humanoid dies it removes the humanoid and sets a BoolValue to true

function onHealthChanged()
	
    script.Parent.CurHealth.Text = script.Parent.Parent.Parent.Humanoid.Health
	if script.Parent.Parent.Parent.Humanoid.Health == 0 then
		script.Parent.Parent.Parent.Parent.Dead = true
		script.Parent.Parent.Parent.Humanoid:remove()
	
		
	end
end
 
script.Parent.Parent.Parent.Humanoid.HealthChanged:connect(onHealthChanged)


and another script that when the BoolValue is true it removes a part

if script.Parent.Dead.Value == true then
	script.Parent.Wall:Destroy()
	
	
	end

but it doesnt remove the part and in the output it says Dead (The BoolValue) is not a valid member of model

1 answer

is the value "Dead" inside whatever the parent of this script is? If not, there's your problem, it could be searching for the value "Dead" when maybe its another layer down or up than a child of the script's parent.

This discussion is preserved as it was. New answers, comments, and votes are closed.