Answered by
5 years ago Edited 5 years ago
I'm not exactly sure what you were going for with this...
1 | local chat = 'This is what will pop up' |
2 | local PlayerName = game.Players.LocalPlayer.Name |
4 | game.StarterGui:SetCore( 'ChatMakeSystemMessage' , { |
5 | Text = '[' .. PlayerName .. ']' .. chat |
I'm not sure how you have your gui's set or anything, that's going to have to be on you... But what I have above does work while in a localscript somewhere within the player.
You're going to have to be a little more detailed if you need some more help. Have any questions? Feel free to comment.
EDITED:
01 | local StarterGui = game:GetService( 'StarterGui' ) |
02 | local player = game.Players.LocalPlayer |
04 | local frame = script.Parent.Parent |
05 | local ChatSayer = script.Parent |
06 | local thingtoSay = frame.ChatText |
08 | ChatSayer.MouseButton 1 Click:Connect( function () |
09 | StarterGui:SetCore( 'ChatMakeSystemMessage' , |
11 | Text = '[' .. player.Name .. '] ' .. thingtoSay.Text |
What I have here is it is setting it every time that you hit that 'ChatSayer' button.
if this isn't what you were wanting then just take out the 'MouseButton1Click function and just set the text to whatever you'd like it to be...
Remember this is going to be local.. if you want it to work on the server you MUST filter it before it is actually sent
But I hope this helps