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?
You're connecting the function wrong, you're doing
script.Parent.ValueA.Value.Changed:connect(CheckValue)
The proper way is to just do
script.Parent.ValueA.Changed:Connect(CheckValue)
It detects when the value of "ValueA" changes, not when the value of the value of "ValueA" changes (if you understand what I mean.)