Idk what is the problem
local Stars = workspace:WaitForChild("Stars") local StarValue = game:GetService("ReplicatedStorage"):WaitForChild("Stars") local function Check() for _, thing in pairs(Stars:GetChildren()) do if thing.ClassName == "Model" then for __, Star in pairs(thing:GetChildren()) do if Star.ClassName == "UnionOperation" then StarValue.Value = StarValue.Value +1 print(StarValue.Value) end end end end end Stars.ChildAdded:Connect(function(m) if m:IsA("Model") then Check() end end)
Stars.ChildAdded:Connect(function(m) wait() if m:IsA("Model") then Check() end end)
Also you use .ClassName and :IsA() its not syntactically incorrect but it just makes the code look bad.