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)
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.