Click detector firing twice

Hello scripters!
Recently I started making a new game and I encountered an issue that NEVER happened to me.
Basically whenever I click on a click detector, or trigger a proximity prompt SOMETIMES they get fired TWICE!!!
I also tried to use a debounce but it doesn’t work…
And as I said, sometimes it fires Twice, sometimes it fires only once…

It’s the first time that this happens to me, anybody knows a possible fix?

Here’s the click detector script:

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	if script.Parent.Parent.Parent.Owner.Value == tostring(plr.UserId) then
		print("GO")
		script.Parent.Parent.IsActivated.Value = not script.Parent.Parent.IsActivated.Value
	end
	
end)
2 Likes

This might be because of the new framerate system. Try playing on 60hz if you’re not already and if the problem persist try another mouse or reinstalling Roblox Studio. Unless Roblox do something about the framerates the bug will remain for a long time.

Oh ok.
If that’s the case… How do I disable the new framerate system?

Let a friend test perhaps, if not, it could be that your mouse is broken causing it to respond two times.

i tested on mobile, on my second pc and the problem still occurs… It’s not the mouse, could it really be for the frame rates?

Did you switch to 60FPS to test?

Seems like I don’t have the option to switch to 60 fps on studio…

It’s usually recommended to place the debounce/stop flag at the beginning before running anything else. For your script, you can either place it on the line before the print, or place before the if statement (however, you’ll need to include an else to reset the value). If not, it very well may be the case mentioned by @FreddDeWB and @Xynterical.

I already tried to use the debounce, but it still doesn’t work ;(

What is your debounce script?
If you could provide it below. (the full script)

debounce = false

script.Parent.MouseClick:Connect(function()
       if debounce == false then
             debounce = true
             print(“GO”)
             wait(.5)
             debounce = false
       end

end)