LocalScript
script.Parent.Parent.Activated:Connect(function()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Chase in progress, 10-0.";
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size96;
})
end)
Your code is perfectly fine, though I suggest using Activated instead of MouseButton1Click since Activated works for all devices, not just computers
Reason why it may not be working:
When you choose "Play Solo" in studio, the chat doesn't always load correctly
If you test in a local server, where the chat does work, you will see the message appear
Make sure that script.Parent.Parent is a Text / Image Button
EDIT, according to your question, it appears that the script's Parent is the button, so you need to remove a parent:
script.Parent.Activated:Connect(function()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Chase in progress, 10-0.";
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size96;
})
end)
EDIT2, In order to get the player name in the chat, the first argument is the message string, so you can say
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = (player.Name..": Chase in progress, 10-0.");
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size96;
})
end)
1 comment
2nd edit