Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Does the speaker Message script need to be in ServerScriptService?

I have problem with the script.

I have script in my model. Yes, not local script.

local Cashier = require(game:GetService("Chat"):WaitForChild('ChatServiceRunner'):WaitForChild('ChatService')):AddSpeaker("Cashier")
local Event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local head = script.Parent
local chat = require(game:GetService("Chat"):WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
local ch2 = game:GetService("Chat")

if not chat:GetChannel("All") then
	while true do
		local ChannelName = chat.ChannelAdded:Wait()
		if ChannelName == "All" then
			break
		end
	end
end

Cashier:JoinChannel("All")

Event.OnServerEvent:Connect(function(msg)
	Cashier:SayMessage(msg, "All")
	ch2:Chat(head, msg)
end)

And if i fire the event, it says nothing! Do it needs to be in ServerScriptService?

1 comment

0

bruh are u like a new scripter or something?

1 answer

local Cashier = require(game:GetService("Chat"):WaitForChild('ChatServiceRunner'):WaitForChild('ChatService')):AddSpeaker("Cashier")
local Event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local head = script.Parent
local chat = require(game:GetService("Chat"),ChatServiceRunner') -- that should fix it
local ch2 = game:GetService("Chat")

if not chat:GetChannel("All") then
    while true do
        local ChannelName = chat.ChannelAdded:Wait()
        if ChannelName == "All" then
            break
        end
    end
end

Cashier:JoinChannel("All")

Event.OnServerEvent:Connect(function(msg)
    Cashier:SayMessage(msg, "All")
    ch2:Chat(head, msg)
end)

2 comments

0

No, i am requring "ChatModule" as "ChatService" in the ChatServiceRunner, And you can't reference non-existing ChatServiceRunner unless you find it with :WaitForChild()

0

Wait, i've found, firing server with removeEvent with an Textbox's Text returns player instance firstly,

This discussion is preserved as it was. New answers, comments, and votes are closed.