speaker:SayMessage is nil?

You can write your topic however you want, but you need to answer these questions:

I want to make a wisdom chat-bot.
When I try to have the chat-bot say something, the ChatMessage is nil

speaker:SayMessage("Message", "All") --> nil

I’ve tried the wiki and a developer discord server but to no avail.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Script

local ball = workspace.Ball
local cantWisdom = false

local wisdomQuotes = require(script.WisdomQuotes)
local ballFunctions = require(script.BallFunctions)

local ballSpeaker = chatService:AddSpeaker("ball of wisdom")
ball.ClickDetector.MouseClick:Connect(function(plr)
	if cantWisdom then return end
	cantWisdom = true
	spawn(function()
		wait(1)
		cantWisdom = false
	end)
	
	local chance = math.random(1, 10)
	if chance ~= 10 then
		local randomQuote = wisdomQuotes[math.random(1, #wisdomQuotes)]
		print(randomQuote)
		local wisdomMsg = ballSpeaker:SayMessage(randomQuote, "All")
	end
end)

All help appreciated, thanks!

put a print after each line to locate which line causes the nil, or the whereabouts atleast. (going to bed so I can’t help)

Never mind! I realized the chat-bot needed to join the channel

2 Likes