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

Trying to make my gui disappear after a button is clicked. Whats wrong?

Asked by 2 years ago
Edited 2 years ago

new to roblox studio need some help with this script

local screengui = game.StarterGui.ScreenGui

script.Parent.MouseButton1Click:Connect(function() local allchildren = screengui:GetChildren()

local numofchild = #allchildren
for i = 1, numofchild do
    local child = allchildren[i]
    child.visible = false
end

end)

0
line 4, change `visible` to `Visible` F100F9 0 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

It Should Look Like This

script.Parent.MouseButton1Click:Connect(function() 
script.Parent.Parent.Enabled = false
end)

The Script Above Only Does Local For Global Do

script.Parent.MouseButton1Click:Connect(function() 
game.StarterGui.ScreenGui.Enabled = false
end)

Local Is For One Player For Example ChadCoolGuy123 Presses The Button But You Don't It Only Goes Away For Him But Global Is For Everyone For Example ChadCoolGuy123 Presses The Button But You Didn't It Goes Away For Both

0
This Script I Put Depends On Where The Button Is Located If It Is Like ScreenGui>Frame>TextButton It Would Be One More Parent ShakeBubble 15 — 2y
0
Thank you Younes_wldn 4 — 2y
Ad

Answer this question