This clientside LocalScript receives a remote event from the server when a player joins, the function onPlayerJoin runs yet the DisplaySystemMessage within it never does. There aren't any errors printed so I'm unsure of the issue.
local player = Players.LocalPlayer
local TextChatService = game:GetService("TextChatService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotePlayerJoinEvent = ReplicatedStorage:WaitForChild("RemotePlayerJoinEvent")
local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
local playerName = player.DisplayName
local function onPlayerJoin()
if remotePlayerJoinEvent then
print("[Client] Event received by player", playerName) -- This runs
generalChannel:DisplaySystemMessage("Hello "..playerName.."!") -- The results of this do not appear in chat.
remotePlayerJoinEvent:FireServer() -- This too
else
warn("[Client] RemotePlayerJoinEvent not found.")
end
end
remotePlayerJoinEvent.OnClientEvent:Connect(onPlayerJoin)```