Here's what I have, I keep getting error messages.
GotoPlayer.MouseButton1Click:Connect(function() BoolV.Value = true else BoolV.Value = false end)
Hope it'll help you
local a = 0; local totalclicks = 2 script.Parent.MouseButton1Click:Connect(function() if (a < totalclicks) then a = a + 1; if a == totalclicks and BoolValue == false then BoolV.Value = true; print("Code executed!"); a = 0 -- Code here elseif a == totalclicks and BoolValue == true then BoolV.Value = false; a = 0 end end end)
Here's a more simpler varient. I believe you want a toggle-able TextButton
. Lemme help ya.
local toggle = true script.Parent.MouseButton1Click:Connect(function() if toggle == true then toggle = false print("Toggle has been switched to false") else toggle = true print("Toggle has been switched to true") end end
I hope I helped! Ask me in the comments if you don't understand anything. Merry Early Christmas!