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)
function onChildAdded(child) --I think you put this in StarterPack I heard that it doesn't work any more so put it in StarterGui. wait(0.25) --it waits for it to load. 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)