im refraining from making the average âstop making my eyes bleed!!!â remark when i say this but PLEASE, if youâre gonna reference the same thing multiple times like you are when you continuously write script.Parent.Parent, make a variable for it instead, it will make the code look so much cleaner
it would look even more cleaner if you put all these GUIObjects into one table and then ran through the table with a loop to set all their visibility to false instead of long, seperate lines
your error is probably coming from âPlayerListsâ either not existing at all or not loading in yet, try adding a :WaitForChild() for that too
local GUIObjects = {-- insert all the things you want to make invisible
}
script.Parent.MouseButton1Click:Connect(function()
list.Playerlist.Visible = true
list.Leaderboard.Header.Visible = true
wait(0.03)
for idx, GUIObject in pairs(GUIObjects) do
GUIObject.Visible = false
end
script.Disabled = true
end)
You said you are getting the following error: Infinite yield possible on âPlayers.SerBogdan03.PlayerGui:WaitForChild(âPlayerListsâ)
On the picture youâve just posted we can see that Itâs âPlayersListsâ instead of âPlayerListsâ so I believe youâre actually referencing it wrong, try to fix that and see if the :WaitForChild actually works
The main task of this script, originally conceived by me, is to hide some game interfaces, and make others visible, in this case, after the player has clicked on the start button of the game, his menu interface will close and a sheet with players will open, which is located on the right side.