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

Does chatted require debounce?

Asked by 10 years ago

If I add an chatted function, is it required to have a debounce? When I use it, I chat something once, but it prints some things twice.

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

No, Chatted should not require any debounce system.

Most likely you have :connect'd twice to the Chatted event in two different places; either in two different instances of a ServerScript, or in a LocalScript;

If your code is running in a LocalScript that the player receives from StarterGui or StarterGear or StarterPack, then every life, a new LocalScript is made and so another connection listening to the event will occur.

In addition, it should be noted that sometimes all of the above mentioned LocalScripts are loaded twice, so if this is occurring even without respawning, that still may be the culprit

Ad

Answer this question