Ive tried using
function CheckToBreak()
if script.Parent.ValueA.Value <= 0 then
script.Parent.ValueA.Value = 9999999
local Clone1 = game.ReplicatedStorage.Parts.Part:Clone()
local Clone2 = game.ReplicatedStorage.Parts.Part:Clone()
Clone1.Position = Vector3.new(script.Parent.Position)
Clone1.Position = Vector3.new(script.Parent.Position)
Clone2.Position = Vector3.new(script.Parent.Position)
Clone2.Position = Vector3.new(script.Parent.Position)
script.Parent:Destroy()
else print(no)
end
script.Parent.ValueA.Value.Changed:connect(CheckValue)
But it doesnt work. Help?

1 comment
Sorry I didn't mean you're connecting the function wrong, I meant that you're not using the Changed event correctly.