When the player say ":D", an image should appear above the player's head. The image is made up from a BillboardGui, which I put inside the script.
function onChatted(msg, speaker)
source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == ":D") then
local laugh = script.Laugh:Clone() -- The BillboardGui is called "Laugh"
laugh.Parent = speaker.Character.Head
wait(2)
laugh:remove() -- image should remove after 2 seconds
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
When I say ":D" in game nothing happens, but when I dragged the BillboardGui inside the player's head in studio mode, the image appears like it should. Help please?
Thanks.

1 comment
Didn't know Adornee was needed ;P