I am looking for a way to get a chatted response from a player. For example, I let my bot say “Hi there, what is your nickname?”. It should then wait for the player to respond and continue executing.
The reason I’m asking it here is because when I make an event listener player.Chatted, it stops the rest of the script (Duh).
Yes. Unless you make your bot smarter. Just only make the bot say “Hi there” when the player chats. Add the code to say other things when the player sends their name. If you’re sending it through a remote event it should be a piece of cake.
Not sure if this is what you’re looking for. Both of these lines have different use cases and will halt any further code execution until the player either chats or says a specific message.
local Players = game:GetService("Players")
local thisPlayer = Players:FindFirstChild("marketmanager1")
--thisPlayer.Chatted:Wait() -- Wait for the player to send a message (can be anything)
--repeat until thisPlayer.Chatted:Wait() == "MSG" -- Wait for the player to send a specific message
local Players = game:GetService("Players")
local thisPlayer = Players:FindFirstChild("marketmanager1")
thisPlayer.Chatted:Wait() -- Wait for the player to send a message (can be anything)
That seems to be what I’m looking for. How’d I get the message content here?