You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want every player in the server to see the chat system message.
What is the issue? Include screenshots / videos if possible!
When a player steps on a block, the chat system message only says for them.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked at YouTube videos and didn’t find anything. The topics I found on the devforum didn’t have the same problem as me. If you do find one though I am sorry for posting this and please flag the topic.
This is a function from my code that makes the messages. This is a local script inside the starter gui.
local function stoptimerandgettime()
local timertime = script.Parent.Text
player.Character.Humanoid.Health = 0
player.Character.HumanoidRootPart.Position = workspace.Lobby.WinnerSpawn.Position
player.leaderstats.Towers.Value = player.leaderstats.Towers.Value + 1
local brickcolor = BrickColor.new("Bright yellow")
game.StarterGui:SetCore("ChatMakeSystemMessage",{
Text = player.Name.." has beaten the tutorial tower in: "..timertime;
Font = Enum.Font.Cartoon;
Color = brickcolor.Color;
FontSize = Enum.FontSize.Size96;
})
end
It’s an interface for Roblox’s default Lua chat. It has server APIs and client APIs all listed on that page. There’s some sample code lying around there which might be useful to you. If you’re still not sure what to do you can check out a recent project of mine that uses ChatService called ChatPlus.
More specifically, I’d recommend checking out the source code here on GitHub for how to actually use the server API.
I am very sorry, but I am not really understanding the ChatService server API. I read through the article and I am really confused. Can you maybe send a sample code that shows the chat service in action through a server script?
local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner").ChatService)
local ServerSpeaker = ChatService:AddSpeaker("Server")
if not ChatService:GetChannel("All") then
while wait() do
local ChannelName = ChatService.ChannelAdded:Wait()
if ChannelName == "All" then
break
end
end
end
ServerSpeaker:JoinChannel("All")
ServerSpeaker:SayMessage("Hey everybody!", "All") --This part is this message sending bit
Ok so @COUNTYL1MITS I have tried that just now and it still doesn’t work. Here is my code.
Function that receives:
local function stoptimerandgettime()
local timertime = script.Parent.Text
player.Character.Humanoid.Health = 0
player.Character.HumanoidRootPart.Position = workspace.Lobby.WinnerSpawn.Position
game.ReplicatedStorage.GiveTowers:FireServer()
game.ReplicatedStorage.ChatMessageComplete.OnClientEvent:Connect(function()
local brickcolor = BrickColor.new("Bright yellow")
game.StarterGui:SetCore("ChatMakeSystemMessage",{
Text = player.Name.." has beaten the tutorial tower in: "..timertime;
Font = Enum.Font.Cartoon;
Color = brickcolor.Color;
FontSize = Enum.FontSize.Size96;
})
end)
end
Script that fires:
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not debounce then
debounce = true
game.ReplicatedStorage.GetTimeAndStop:InvokeClient(player)
game.ReplicatedStorage.GiveTowers.OnServerEvent:Connect(function()
player.leaderstats.Towers.Value = player.leaderstats.Towers.Value + 1
print("Received remote event message and gave player a tower point.")
end)
game.ReplicatedStorage.ChatMessageComplete:FireAllClients()
wait(10)
debounce = false
end
end
end)