Basically, I already asked this question a while ago and got a somewhat decent answer that somewhat solved the problem, until I came up to this problem with these scripts, and I'll explain it in a moment.
My goal that I wanted to meet was being able to have a button, on being touched by a person, make a large model, consisting of NPCs within it, platforms, and even other large models to become fully visible and cancollide. If this doesn't make sense, here's the general thing Im trying to say: On button press, model appears which consists of other models, NPCs, and other buttons which can then spawn in other models, like a huge continuing chain of events that continues every step of the way once a button has been touched
Here's my original script which I learned could only make individual parts become non-transparent and cancollide, not models, NPCs, or other things I had listed.
bob = script.Parent.Parent.Part function onTouch(part) bob.Transparency = 0 bob.CanCollide = true end script.Parent.Touched:connect(onTouch)
A solution, the user Time_URSS had given me, allowed me to pass this limit and make parts within models become fully visible and cancollide. This, however, did not include NPCs, and made it extremely difficult for being able to have the thing that I had explained - button-touch-events within button-touch-events. His code is as follows:
bob = script.Parent.Parent.Part function onTouch(part) for k,v in pairs(bob:GetChildren()) do v.Transparency = 0 v.CanCollide = true end end script.Parent.Touched:connect(onTouch)
Does anyone know a better way I can write this script to do as I want, or if I am stuck having to model within model within model within model with no NPCs and perhaps even unions? I know there is a way, through Event handling and other things (correct me if Im wrong), but I just don't know how to use them corresponding to scripts.
Thank you, and if needed I am fine with elaborating or clearing anything up.
tl;dr Is there a way I can have a button make a model visible and cancollide, consisting of NPCs, other buttons that can do the same jobs for other models, and unions? All without making a huge model within model within model cluster of things that after a while may end up being extremely hard to navigate through in studio?