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

GUI visibility won't enable from a text button surface gui?

Asked by
zomspi 541 Moderation Voter
4 years ago

I have a text button and want to my a GUI visible, but it isn't doing anything.

script.Parent.Activated:Connect(function()
    game.Players.LocalPlayer.PlayerGui.ScreenGui.Laptop.Visible = true
end)

0
Maybe you could change the BackgroundTransparency instead. DesertusX 435 — 4y

2 answers

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago
script.Parent.Activated:Connect(function()
    game.Players.LocalPlayer.PlayerGui.ScreenGui.Laptop.Visible = not  game.Players.LocalPlayer.PlayerGui.ScreenGui.Laptop.Visible
end)

0
It is set to invisible so when I click it shouldn't it make it visible? I don't want it 2 ways zomspi 541 — 4y
0
? This script basically makes it the opposite of what yo do for e.g. If its visible then when you click it again its not visible JesseSong 3916 — 4y
Ad
Log in to vote
0
Answered by
DesertusX 435 Moderation Voter
4 years ago

Just use BackgroundTransparency. Set the BackgroundTransparency of your Frame to 1 and use this script.

script.Parent.Activated:Connect(function()
    game.Players.LocalPlayer.PlayerGui.ScreenGui.Laptop.BackgroundTransparency = 1
end)
0
Sorry, for line 2 I meant 0. DesertusX 435 — 4y

Answer this question