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

Despite everything being set up right and no errors and output, GUI isnt changing?

Asked by 4 years ago

This is a script inside of a textbox inside of a GUI inside of a Folder inside StarterGUI. The GUI that the script is trying to change is in the same folder as the GUI the textbox is in. any help?

local mask = script.Parent.Parent.Parent.CameraCore

function MouseOver()
    if mask.Enabled == false then
        mask.Enabled = true
    elseif mask.Enabled == true then
        mask.Enabled = false
    end

end


script.Parent.MouseEnter:connect(MouseOver)

1 answer

Log in to vote
1
Answered by 4 years ago

Try this:

local mask = script.Parent.Parent.Parent:WaitForChild("CameraCore")--Edited this so that it waits for the object to load

function MouseOver()
    mask.Enabled = not mask.Enabled--Simpler solution, not basically returns the opposite of it so if you had print(not false) it would print true
end


script.Parent.MouseEnter:connect(MouseOver)
Ad

Answer this question