Hello! I’m making an Emote script, which is activated by saying a certain word in the chat, for example “bored”.
I’m using TextChatService for it to see the message, and this is what I’ve got right now.
I’d like to make it so if the certain word is inside the if statement for the emote, the chat bubble doesn’t appear.
TextChatService.MessageReceived:Connect(function(textchatmessage)
local message = textchatmessage
print(message)
local msg = message.Text
print(msg)
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local SoundManager = require(game:GetService("ReplicatedStorage").Modules.Shared:WaitForChild("SoundManager"))
local RS = game:GetService("ReplicatedStorage"):WaitForChild("ReplicatedAssets")
local CurrentAnim
--print("chatted..?")
if ACD then print("returned") return end
print("Chatted")
if msg then
print(msg)
--print("message :D "..msg)
msg = string.lower(msg)
print(msg)
local ACD = true
local shouldloop
if msg == "dab" then
print("do emote: "..msg)
CurrentAnim = Humanoid:LoadAnimation(RS.CharacterAnims.Animations.dab)
CurrentAnim:Play()
shouldloop = true
end
end
end)
If there’s any way to also improve it, please let me know, and thank you!