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
9 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)

button = script.Parent
window = script.Parent.Parent.Parent

function onClicked(GUI)
    window:remove()
end

script.Parent.MouseButton1Click:connect(onClicked)

2 answers

Log in to vote
-1
Answered by 9 years ago

Maybe try this:

local button = script.Parent
local window = script.Parent.Parent.Parent

function onClicked(GUI)
    window.Transparency = "1"
end

script.Parent.MouseButton1Click:connect(onClicked)

IDK if that will work...

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

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

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

And make another local script:

function onClicked()
if game.Players.LocalPlayer.Testing.Value == true then
game.Players.LocalPlayer.Testing.Value = false
else
game.Players.LocalPlayer.Testing.Value = true
end
end

Answer this question