Anyone who is facing this problem can check if the button is disabled like this...
1
2
3
4
5
2
3
4
5
text="(disable)" if text:sub(1,1)=="(" and text:sub(string.length(text),1)==")" then --disabled end
text="(disable)" if text:sub(1,1)=="(" and text:sub(string.length(text),1)==")" then --disabled end