(First post)
The script is just a normal script.
I have a part with an attribute called rockHP. (Which is the parent of this script.)
rock = script.Parent
print("test 1")
rock:GetAttributeChangedSignal("rockHP"):Connect(function()
print("attribute changed")
local rockHP = rock:GetAttribute("rockHP")
print(rockHP)
if rockHP <= 0 then
rock:Destroy()
end
end)
print("test 2")
When I manually change it this script doesn't detect anything.
I've tried to find answers online but I couldn't find any that fit my problem.

1 comment
Ty for that. I understand the gist of it now.