Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Somewhat Simple GUI Problem?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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!

Ad

Answer this question