workspace.Nods.DescendantAdded:Connect(function(nod)
print(nod)
if nod:IsA("BasePart") and NodRelatedStorage:FindFirstChild(nod.Name) then
print(nod)
local Nod_Durability = nod:GetAttribute("Durability")
local HealthBar = nod:FindFirstChild("HealthBar"):FindFirstChild("Background"):FindFirstChild("Durability")
end
end)
this function doesnt launch for some reason (it doesnt print anything)
I try to detect when an Instance gets added to those folders (with the red arrows)
--Nod Health Bar
workspace.Nods.Common_Nods.DescendantAdded:Connect(function(nod)
print(nod)
if nod:IsA("BasePart") and NodRelatedStorage:FindFirstChild(nod.Name) then
print(nod)
local Nod_Durability = nod:GetAttribute("Durability")
local HealthBar = nod:FindFirstChild("HealthBar"):FindFirstChild("Background"):FindFirstChild("Durability")
end
end)
``` I did this
It should print since there are nods are getting added to the folder, but doesnt print anything
That doesn’t say if it’s connected, use this to know if it connects:
local connection = workspace.Nods.DescendantAdded:Connect(function(nod)
print(nod)
end)
print("Status: "..(connection and "Connected" or "Failed to connect"))
@woitur are the Nods being added through a local or server script, if they are added through a local script then the server doesn’t see the nod’s so the function doesn’t fire.
This seems to be the only reason this would happen