Attempt to concatenate nil with string (GUI)

You can write your topic however you want, but you need to answer these questions:

  1. What is the issue?
    Trying to make it so when you click the GUI button it sent a message in the Server/InGame chat. Due to 1 line of code that is erroring out, so close to getting this to work.


    so close to getting it to work but, one issue in 1 line of code.

  2. What solutions have you tried so far?
    yes I have, seen that you can create a new message with ChatMakeSystemMessage in chat simple, but no tutorials on the Gui version of this.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

game.ReplicatedStorage.ClickedUI.OnClientEvent:Connect(function(PlrName)

	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = "[SYSTEM]: "..PlrName.." said hi to all of you :)",--Error right here
		Color = Color3.fromRGB(255, 255, 65),
		Font = Enum.Font.FredokaOne,
		TextSize = 18,
	})
end)
local RS = game.ReplicatedStorage

local function Clicked(Player)
	print("clicked1")
	RS.ClickedUI:FireClients(Player)
	print("clicked2")
end

script.Parent.MouseButton1Click:Connect(Clicked)

Please do not ask people to write entire scripts or design entire systems for you. I just need 1 simple fixed line of code.

FireClients doesn’t exist a function of a RemoteEvent

You’ll want to use a remoteevent to fire to the server, and then fire back to all the clients
FireServer
FireAllClients

I have tried the FireAllClients and the same error appers.


In short you should FireServer() from the client that presses the button. Within the function called on the servers end, you would FireAllClients and pass the name of the player who pressed the button as a parameter.

1 Like