I need help figuring this out. What I want to achieve is, if somebody chats anything, their face changes its decal until it is finished. I haven't found anything on it, and I can't figure anything out.
COMMUNITY QUESTION
Change faces when chatting?
2 answers
There's not a specific event that fires when your chat bubble vanishes, but we can add a wait
local GreetingSynonyms = {"hi", "hey", "hello", "howdy", "whats up?", "what's up?"}
local Id = 1230123 -- your id
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local OriginalFaceTexture = plr.Character.Head.face.Texture
for i, v in pairs(GreetingSynonyms) do
if string.lower(msg) == v then
print(plr.Name .. " greeted option: " .. i)
plr.Character.Head.face.Texture = "rbxassetid://" .. tostring(Id)
wait(2)
plr.Character.Head.face.Texture = OriginalFaceTexture
break
end
end
end)
end)
There is no event on the Player that detects whether the player is typing in the chat or not. But, you can also use the Userinputservice to detect the Enum.KeyCode.Slash. This is the keycode that opens the chat so you can actually take advantage of this and make the script you wanted.
This discussion is preserved as it was. New answers, comments, and votes are closed.
