Firing message to everyone

I wrote a local script that displays what was unboxed but unfortunately it only displays for the client

local rs = game:GetService("ReplicatedStorage")
local unboxEvent = rs:WaitForChild("UnboxDisplayer")

local legendaries = {
	"Angel of Angels", "Endless Void", "Witch Companion"
}

local epics = {
	"Burning Sensation", "Clover Companion"
}

local rares = {
	"Glitter Companion", "Pink Cyborg"
}

local uncommons = {
	"Triangular Companion", "Orange Dash"
}

local commons = {
	"Blu Companion", "Blue Ripples"
}

unboxEvent.OnClientEvent:Connect(function(itemChosen)
	local color
	if table.find(legendaries, itemChosen) then
		color = Color3.fromRGB(255, 152, 25) -- Orange color for legendaries
	elseif table.find(epics, itemChosen) then
		color = Color3.fromRGB(240, 74, 146) -- Purple color for epics
	elseif table.find(rares, itemChosen) then
		color = Color3.fromRGB(102, 54, 247) -- Blue color for rares
	elseif table.find(uncommons, itemChosen) then
		color = Color3.fromRGB(33, 233, 255) -- Yellow color for uncommons
	else
		color = Color3.fromRGB(124, 227, 55) -- Cyan color for commons
	end

	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = itemChosen .. " has just been unboxed by " .. tostring(game.Players.LocalPlayer) .. "!",
		Color = color,
		Font = Enum.Font.SourceSansBold,
		TextSize = 18,
	}) 
end)

1 Like

have u tried firing unboxevent with :FireAllClients()?

1 Like

I’m firing this from my server script, I’m not sure if it would work if i put fireallclients

unboxDisplayer:FireClient(plr, itemChosen.Name)

yeah, if u want everyone to get the event then use :FireAllClients(). using just :FireClient(plr) will fire it to only one person. (unless u use a for loop but fireallclients would be easier)

1 Like

You’re only firing the remote to one player, this means only the client will see the message, instead do.

unboxDisplayer:FireAllClients(itemChosen.Name)
1 Like

Can I forward the player somehow?

In my script I’ve got

Text = itemChosen .. " has just been unboxed by " .. tostring(game.Players.LocalPlayer) .. "!",

Yes, the event is firing to everyone, but then it would display their own name

I’m also pretty sure Roblox doesnt register callbacks for “ChatMakeSystemMessage” anymore if you’re using the new chat, i think Roblox uses :DisplaySystemMessage() now.

Sorry i didnt quite understand. Can you send screenshots or something?

I think I fixed it with

unboxDisplayer:FireAllClients(itemChosen.Name, plr.Name)

and

Text = itemChosen .. " has just been unboxed by " .. tostring(plr) .. "!",
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.