Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Somewhat Simple GUI Problem?

For some reason I dont believe the :GetChildren() is working, because when I join a new server nothing comes up.

MouseButton1Down:connect(function(players)
	if script.Parent.Text == "Players" then
		script.Parent.Text = "Close"
	local plays = game.Players.LocalPlayer.PlayerGui.Playerz:GetChildren()
	if plays.ClassName == "TextButton" or "Frame" then
	plays.Visible = true 
	end
	end
end)

If you do need pictures of what I am trying to do just comment -DevShowcase

1 answer

You need a for loop.

Example:

stuff = game.Workspace:GetChildren()

for i = 1, #stuff do -- repeat the following 1-> the number of stuff in workspace
if stuff.Name == "laugh" then
stuff:Destroy()
end
end

Hope I helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.