Help with chat script

There are no errors, any reason you can think of why this isn’t working? LocalScript in StartGui

local winEvent = game:GetService("ReplicatedStorage").WinEvent
local player = game.Players.LocalPlayer

winEvent.OnClientEvent:Connect(function(plr)
	startgui:SetCore("ChatMakeSystemMessage",{
		Text = player.winnerName.Value.." has won the game!ww";
		Color = Color3.fromRGB(50,205,50);
		Font = Enum.Font.Roboto;
		FontSize = Enum.FontSize.Size24;
	})
end)
2 Likes

Have you tried PlayerGui? Maybe it’ll be there?

Can you help me with the wins part? I’m doing a minigame game as well, and am in need for a wins system.


I think I have the solution, is Roblox wants me to give it to you.

Are you sure there are no errors? I don’t see a variable declaration for startgui for one. You should try debugging your code roughly by adding prints throughout the code and seeing which ones run and which ones do not.

Make sure WinEvent is a valid event and is in ReplicatedStorage. I would also make sure the event is actually being fired from the server. (aka make sure the server is firing the event)

Possibly, you can try PlayerGui, if it still doesn’t work. Maybe try correcting some of them?

For example:

game.Workspace.Gravity:FindFirsChild

Always correct it, so it don’t cause error. Try doing:

local winEvent = game:GetService("ReplicatedStorage").WinEvent
local player = game.Players.LocalPlayer

winEvent.OnClientEvent:Connect(function(plr)
	StarterGui:SetCore("ChatMakeSystemMessage",{
		Text = plr.winnerName.Value.." has won the game!ww";
		Color = Color3.fromRGB(50,205,50);
		Font = Enum.Font.Roboto;
		FontSize = Enum.FontSize.Size24;
	})
end)

Maybe, you haven’t had something to connect it, for example. Make something with locals:

local StarterGui = game.StarterGui -- For example.
1 Like

I fixed it, forgot to give it a value to use, would have deleted it but its not letting me2021-03-02 07_46_41-Window

You can just ignore this post, as it will just go through the community. (If they saw this has a solution, they won’t come in this post again.)

1 Like