Hello all! Im trying to make a message broadcast to EVERY SERVER When someone gets a badge, Like this:
“Player got the Secret badge!”
Current code (Egg hunt code that I had earlier, Does not broadcast globally nor activates once badge is given, Its activated via Collison)
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local server = ChatService:GetSpeaker("Server") or ChatService:AddSpeaker("Server")
server:JoinChannel("All")
server:SetExtraData("NameColor", Color3.fromRGB(255, 255, 255))
server:SetExtraData("ChatColor", Color3.fromRGB(0, 255, 255))
wait(2)
script.Parent.Touched:Connect(function(hit)
script.Parent.Transparency = 1
script.Parent.CanTouch = false
script.Parent.CanQuery = false
script.Parent.CanCollide = false
local char = hit:FindFirstAncestorOfClass("Model")
server:SayMessage(char.Name.." has got the Egg of Developer #15!", "All")
task.wait(30)
script.Parent.Transparency = 0
script.Parent.CanTouch = true
script.Parent.CanQuery = true
script.Parent.CanCollide = true
end)
Thanks!