Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does the speaker Message script need to be in ServerScriptService?

Asked by 3 years ago

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?

0
bruh are u like a new scripter or something? kidsteve923 139 — 3y

1 answer

Log in to vote
-1
Answered by 3 years ago
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)

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() TestingPlayer1_EP1 0 — 3y
0
Wait, i've found, firing server with removeEvent with an Textbox's Text returns player instance firstly, TestingPlayer1_EP1 0 — 3y
Ad

Answer this question