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

How do I keep a GUI removed?

Asked by
Moosee 62
10 years ago

Hellu, I created a RemoveButton script but whenever I reset anyway, it comes back, I was wondering if someone could help me with keeping it removed until they join back after leaving or something.

This is what the script looks like: (its a local script btw) (also it does work)

1button = script.Parent
2window = script.Parent.Parent.Parent
3 
4function onClicked(GUI)
5    window:remove()
6end
7 
8script.Parent.MouseButton1Click:connect(onClicked)

2 answers

Log in to vote
-1
Answered by 10 years ago

Maybe try this:

1local button = script.Parent
2local window = script.Parent.Parent.Parent
3 
4function onClicked(GUI)
5    window.Transparency = "1"
6end
7 
8script.Parent.MouseButton1Click:connect(onClicked)

IDK if that will work...

Ad
Log in to vote
-1
Answered by 10 years ago

What I will do is I will add bool value to starter pack. Name it "Testing". Script should be local script.

1while wait() do
2if game.Players.LocalPlayer.Testing.Value == true then --Checks Bool Value That Is Named Testing
3window.Transparency = 1 --If Testing Is True (Enabled) Then It Will Make It Invisible.
4else --If False
5window.Transparency = 0 --Make Window Visible.
6end
7end

And make another local script:

1function onClicked()
2if game.Players.LocalPlayer.Testing.Value == true then
3game.Players.LocalPlayer.Testing.Value = false
4else
5game.Players.LocalPlayer.Testing.Value = true
6end
7end

Answer this question