I'm trying to set every frames visibility to false within a folder. The folder is located here: script.Parent.Parent.Parent
All the frames are inside this folder.
Why doesn't this work?
script.Parent.MouseButton1Down:connect(function() local allinfo = script.Parent.Parent.Parent:GetChildren() allinfo.Visible = false end)
I think your hierarchy must be mixed up. Are you using a local script? Will this be for all players or just a few? If it is for all players, just use a normal script, cycle through the players and change the frames to visible.
If its only for select players, use a local script and change it for those selected members within there.
Hierarchy:I wouldn't access the gui by doing script.Parent.Parent.Parent ect., instead, find out where the gui is from game.Players.LocalPlayer and access it that way.
Note... If your gui is in StarterGui then is will be stored under game.Players.PlayerGui exactly as it is under StarterGui
--normal script for _, player in ipairs(game.Players:GetChildren()) do frames = player.PlayerGui.PathToFrameFolderHere:GetChildren(); for i = 1, #frames do frames[i].Visibility = true; end; end; --local script condition = true; --boolean to see if you want to set frame visible for this particular player if(condition) then frames = game.Players.LocalPlayer.PlayerGui.PathToFrameFolderHere:GetChildren; for i = 1, #frames do frames[i].Visibility = true; end; end;