Hi, This is a hard question I’ve been struggling with for a while now. I have a script that waits for you to touch a part, and when you touch it, it generates a new part. What I need to do is for the script to then wait for that new part, and do the function, over and over again.
I typed up this script, but I am not a professional scripter, so feel free to point out my errors. Thank you to anyone that helps
local ModelRed = game.Workspace.RedBase
for _, Part in pairs(ModelRed:GetChildren()) do -- this is the part I'm struggling with, recognizing the new part
if Part:IsA('Part') then
Part.Touched:Connect(function()
local newPart = Instance.new("Part")
newPart.Parent = game.Workspace.ModelRed
--? How do I make a touched event for this new Part, that then basically repeats infinitely, for every new part generated? It needs to apply to the new part, and the older parts at the same time, if that makes sense.
end)
end
end
Thanks to anyone that can help me, or understands what I am asking. I don’t need a whole script, just a few pointers that could lead me in the right direction.