Chat Bubble issues

Hey trying to fix a bug with there chat stacking off to the side as shown here:
image

I have tried, waiting between each message in case it’s a issue with chatting to fast but can’t seem to find a solution.

1 Like

I’m confused. What scripting issue are you trying to solve here?

As far as I know this is just a Roblox chat issue in general as I have seen in various games.

Sorry! I could not think of another place to put it, but the function I use to make the messages is

function Chat(msg)
wait()
game:GetService("Chat"):Chat(script.Parent.Head, msg, Enum.ChatColor.White)
end

1 Like

Ah I see, thanks for clarifying. One solution you might try is adding a delayed cooldown. Here’s what I mean:

   local chatting = false --bool to check if they are currently chatting
   local cooldown = (numberhere)   --make it however long it takes for chat bubbles to dissipate


   function Chat(msg)
   wait()
   if chatting == false then --check if they are already chatting
   chatting = true
   game:GetService("Chat"):Chat(script.Parent.Head, msg, Enum.ChatColor.White)
   wait(cooldown) --wait until chat bubble dissipates
   chatting = false
   elseif chatting == true then --if they are chatting, wait until they are not and then process our original chat request
   repeat wait() until chatting == false
   chatting = true
   game:GetService("Chat"):Chat(script.Parent.Head, msg, Enum.ChatColor.White)
   wait(cooldown)
   chatting = false
   end
   end

so essentially we are just taking any overlapping chat requests and processing them once the queue is clear.

4 Likes

Thanks! let me test it out :slight_smile:

1 Like

Just add a debounce/cooldown like @nrd1229 said.

local Debounce = true

function Chat(msg)
   if Debounce == true then
      Debounce = false
      game:GetService("Chat"):Chat(script.Parent.Head, msg, Enum.ChatColor.White)
      wait(0.5)
      Debounce = true
   end
end
1 Like

This a great solution as well, but it would require him to implement the same cooldown into the wholefood ordering interface(at least thats what I think it is).

1 Like