--"Dysgenics" is just an avatar model (NPC)
function onChatted(message, player)
if message == "Hi" then
local ChatService = game:GetService("Chat")
ChatService:Chat(game.Workspace.Dysgenics.Head, "Hello, "..player.Name.."!", "Blue")
end end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
The script works when put directly in the Workspace.
However, it doesn't work if I change its parent, clone and copy it to the Workspace from the model or if I just leave it in the character/avatar/NPC.
-13/11/15 |