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

My hide gui button isn't working! Ive tried a lot so I've came here. How do u fix it?

Asked by 4 years ago

its a Jojo's poses type game. like an add-on for yt videos. im not the best at Lua so tell me what I've done wrong cuz the script isn't working. here's the script:

local CloseButton = game.StarterGui.CloseGui.Closebutton

if CloseButton mouseButton.clicked1
then
    game.StarterGui.MainGui
    Visible = 0
end

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local CloseButton = game.StarterGui.CloseGui.Closebutton

CloseButton.MouseButton1Click:connect(function()
(path to the GUI, example: script.Parent.Parent).Visible = False

This is mine if you wanna change it up

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.Visible = false
end)

this basically just closes the gui it is in

0
doesn't work sealzrcool 6 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
local CloseButton = game.StarterGui.CloseGui.Closebutton

CloseButton.MouseButtonClick:Connect(function()
    game.StarterGui.MainGui.Visible = false
end

MouseButton.Clicked1 does not exist as a function nor an event and don't use then after a MouseButton detection event, do

CloseButton.MouseButton1Click:Connect(function()
    --Code here....

, not

if CloseButton mouseButton.clicked1
    then
        --Code here, but its the wrong usage

and Visible is a property of a GUI, and its a BoolValue(it has 2 states, true or false) it is not an integer to determine which it is

0
like the other guy's it doesn't work sealzrcool 6 — 4y

Answer this question