ok so the tile explains itself, i want to make that when the player click the part a dialogue pops up (done) but to response the dialogue u need to type in chat, but it just detects the message multiple times
code:
script.Parent.ClickDetector.MouseClick:Connect(function(plr) repeat wait until plr.Chatted plr.Chatted:Connect(function(msg) if msg == "yes" then print("test") end end)
when i use it once, it works perfectly fine, but when i talk to him again, it fires twice.
I think it just keeps making event listeners so the solution would be to disconnect events as such:
script.Parent.ClickDetector.MouseClick:Connect(function(plr) repeat wait() until plr.Chatted local connection connection = plr.Chatted:Connect(function(msg) if msg == "yes" then print("test") connection:Disconnect() end end)