Is there any way to access my "Speaker" script?

I have a Script in ServerScriptService which is my Speaker script. I use it to tell the server when someone joins and whatnot.

help

Here is the code for my Speaker script:

local players = game:GetService("Players");

local serverScriptService = game:GetService("ServerScriptService");
local chatServiceModule = require(serverScriptService:WaitForChild("ChatServiceRunner").ChatService);
local serverMessageColor = {
	Color3.fromRGB(255, 255, 127);
}

local serverSpeaker = chatServiceModule:AddSpeaker("SERVER");
serverSpeaker:SetExtraData("NameColor", serverMessageColor[1]);
serverSpeaker:JoinChannel("ALL");

serverSpeaker:SayMessage("HI");

...
...
...

I looked at ModuleScripts, but they’re only a one-way execute, from what I’ve heard? Also, they don’t accept parameter calls, correct? Anyways, what would be the best way to work the speaker script?

Question. Do Module Scripts have the ability to listen on whether or not a player joins?

Example:

  1. Bob joins the game.
  2. Module Script detects that bob joined the game.
  3. Module Script outputs “Hi Bob!”

Edit: I know I can do that on a Global script and then tell the Module Script to output it, but I was just wondering. Still a beginner at this stuff. :smiley:

WAIT SCRATCH THAT-- I AM SO SORRY. ModuleScript CAN CALL THE PLAYERADDED FUNCTION. What has to happen first is that the ModuleScript is required by another script.

That is completely my mistake. Once again, my apologies. I’m going to edit my previous posts, so I don’t confuse anybody.

1 Like

Awesome! At least you’re trying to help. Thank you so much!

I’ve edited my previous post with a script example on how you can accomplish PlayerAdded within a ModuleScript.

1 Like