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

Help with functions? [closed]

Asked by 8 years ago

I need help with functions, To where if you click it once you click the textbutton disappears then if you click it again it shows. Any help? If you got skype reply with your skype

Closed as Not Constructive by adark

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

3 answers

Log in to vote
0
Answered by 8 years ago

Not a request site but I will get you started

function onClicked() -- function
       if script.Parent.Visible == false then -- checks if it is visible
           script.Parent.Visible = true
       else
           script.Parent.Visible = false
end

script.Parent.MouseButton1Down:connect(onClicked) -- Clicked detection

Also not sure what your whole question is because you cant click a button that is not visible.

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

To do it:

local debounce = true
script.Parent.MouseButton1Down:connect(function()
    if debounce == true then
        debounce = false
        script.Parent.BackgroundTransparency = 1
    else
        script.Parent.BackgroundTransparency = 1
        debounce = true
    end
end

Hope I helped :)

Log in to vote
-2
Answered by 8 years ago
local textbutton = script.Parent

function openclose()
    if textbutton.Visible == true then textbutton.Visible = false
        else
            textbutton.Visible = true
    end
end

textbutton.MouseButton1Down:Connect(openclose)

Should work. I wrote it quickly though.. comment if it doesn't and I'll fix it.

0
Tab. your. script. jesus. christ. NotSoNorm 777 — 8y