Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with functions?

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

3 answers

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.

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

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.

1 comment

0

Tab. your. script. jesus. christ.

This discussion is preserved as it was. New answers, comments, and votes are closed.