Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Click Detector firing twice?

Asked by 5 years ago
Edited 5 years ago

Hi! I have a big problem with the click detector mechanic.. 2 days ago it worked flawless but today my gamers are experiencing a trouble that breaks almost the entire game.

Click Detector in a model fires twice. It only happens in server or team test, but no in solo play in editor.

Here's the code:

local click = script.Parent.ClickDetector

local debounce = false

function OnClickMe(player) print("help.. :(") end

click.MouseClick:connect(function(player) wait() if debounce == false then debounce = true OnClickMe(player) debounce = false end end)

The outcome is "help.. :(" printed twice in the server output. Any ideas? i'm having a big problem because it affects gamepasses :S Thank you all!

0
Can you confirm that there are not two scripts being created? LegitmateTrades 159 — 5y
0
yes, there is only 1 script, attached to the model cKolmos 0 — 5y
0
The problem here might be the developer console glitch. Because of the new developer console released, everything is printed twice once the old console is opened. https://devforum.roblox.com/t/console-is-double-printing-output-after-console-is-opened/153103 Are you sure that everything is running twice - or is it simply printing twice chomboghai 2044 — 5y

Answer this question