I've tried debounce, i've tried locking the mouse but it can still click, and locking center could still spam the button before it locks your mouse
here's a little snip of my code:
option2.MouseButton1Click:Connect(function()
local debounce = false
if not debounce then
debounce = true
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
UserInputService.MouseIconEnabled = false
option1.Parent.Enabled = false
option3.Parent.Enabled = false
wait(1)
textbox.Text = "."
wait(1)
textbox.Text = ".."
wait(1)
textbox.Text = "..."
wait(3)
debounce = false
option1.Parent.Enabled = true
option3.Parent.Enabled = true
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
UserInputService.MouseIconEnabled = true
end
end)

4 comments
There is a property of TextButton called Selected, set it to false
i've tried that too, it doesn't disable it from being able to be pressed twice after the code has run
Then maybe add that debounce and if it can do code set it to true.
Or if you wan't to make it looks like not selectable, Set AutoButtonColor to false and Disable code in script with debounce