How Do I Make Another User Talk

Hello there. I have made admin commands for my game and I want to make a talk command so when you type talk and words after it it will speech for them. Ive been looking every where and cant find anything thanks

1 Like

For the player talking in the chat, you’d need to get the module for the chat in ServerScriptService that is created upon joining. I made my own code to say random sports games in the chat every 10 seconds:
image
Code used:

local Players = game:GetService("Players")
local SSS = game:GetService("ServerScriptService")
local ChatService = require(SSS:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

local messages = {"football", "basketball", "baseball", "volleyball", "hockey"}

Players.PlayerAdded:Connect(function(player)
	while not (ChatService:GetSpeaker(player.Name)) do wait() end
	local speaker = ChatService:GetSpeaker(player.Name)
	
	while true do
		wait(10)
		local m = messages[math.random(1, #messages)]
		speaker:SayMessage(m, "All")
	end
end)

For the player’s bubble chat, you’d need to look into the Chat of the Chat service. There’s a sample code in the documentation of the function

3 Likes