Would this work? This is just an example but imagine i’m making a close and open script, if i press it it will close and if i press it again it opens, i usually make two scripts for this so i’m trying this now, so would this script work:
local idkaname = false
script.Parent.ClickDetector.MouseClick:Connect(function()
if idkaname == false then
-- Code if the player presses once
idkaname == true
end
elseif idkaname == true then
-- code if the player presses twice
idkaname = false
end
end)