I made a "ChildAdded" script, but it doesn't seem to work. It's supposed to change the text of a Gui in a player when a child is added into the "leaderstats" model. For some reason, it's not working, or even detecting the child being added. I tried a "script.Parent.ChildAdded:connect(function(child)" kind of thing, too, but that doesn't work either. Here's the script:
local function onChildAdded(child)
print("Script has detected a child added")
script.Parent.Parent.PlayerGui.Notifications.Play.Text = ("1"..child.Name.."added to inventory")
wait(4)
script.Parent.Parent.PlayerGui.Notifications.Play.Text = " "
end
script.Parent.ChildAdded:connect(onChildAdded)

1 comment
Where is the script in the Instance Hierarchy?