How would I make this gui double clickable

Currently, I am making a double click script, but I am unable to do anything after making the gui clicked enable, but it doesn’t work. I’m trying to troubleshoot the issue via print scripts, but nothing is happening.

local GUIS = script.Parent.Parent.Parent
local YINGYANG = script.Parent
local MoveCre = GUIS.MoveCre
local PressedTwice = false
local curr = 0
local prev = 0
local Debounce = false


YINGYANG.MouseButton1Down:Connect(function()
	if Debounce == false then
		Debounce = true
	if not MoveCre.Enabled then
		MoveCre.Enabled = true
		PressedTwice = true
		print("Pressed")
	end
	
	curr = os.clock()
	
	local PT = curr - prev
	if PT < 1 and MoveCre.Enabled then
		print("Boom")
		MoveCre.Enabled = false
		PressedTwice = false
	end
end
	
end)

Is that in a local script or in a normal script? Also is this a Button (TextButton)?

It’s an image button, this is a local script within a gui.

1 Like

Could I get a Screenshot of the GUI`s ?
Also something is wrong with your script.
Just a Question: is MoveCre.Enabled or not?

Originally, it is not. (MoveCre), and I’ll send a gyazo video.

1 Like

image
image

1 Like

@ZensStarz You want to enable and disable MoveCre?

There’s a simple three line solution.

YINGYANG.MouseButton1Click:Connect(function()
    MoveCre.Enabled = not MoveCre.Enabled
end)
1 Like

Aw man. It was so simple. Tysm.

1 Like