How would I check if a certain folder gets items in it?
Hello, so I am trying to create an inventory system for morphs. How it works is when items enter the folder, it clones a gui with the information. How do I tell through the script if the folder obtains new items in it? Sorry if this seems like a simple question.
01 | local folder = game.Players.LocalPlayer:WaitForChild( "Animals" ) |
03 | local frame = script.Parent.Parent:WaitForChild( "Box" ) |
05 | local template = script.Parent:WaitForChild( "Template" ) |
07 | for _, animal in pairs (folder:GetChildren()) do |
08 | local newTemplate = template:Clone() |
09 | newTemplate.Name = animal.Name |
10 | newTemplate.ObjectName.Text = animal.Name |
11 | newTemplate.Visible = true |
12 | newTemplate.Parent = frame |
14 | local object = animal:Clone() |
15 | object.Parent = newTemplate.ViewportFrame |