Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ChatMakeSystemMessage Chat part not working?

Asked by 4 years ago
Edited 4 years ago

I'm making a custom chat system message thing, and the the [Playername]: Part of the script pops up, but the text that is supposed to pop up isn't, help? https://i.imgur.com/XpZreEB.png

0
It doesn't look like you ever set a GUI to a value. You create what looks like a variable instead by doing Text ="... beeswithstingerss 41 — 4y
0
What do you mean? RedWirePlatinum 53 — 4y
0
Text is not equal to anything inside of that picture, therefore, the game thinks text is a variable, not what you want the gui to be set as beeswithstingerss 41 — 4y
0
How would I be able to fix the problem? I'm not all that good with rlua coding yet so eheh RedWirePlatinum 53 — 4y

1 answer

Log in to vote
0
Answered by
IDKBlox 349 Moderation Voter
4 years ago
Edited 4 years ago

I'm not exactly sure what you were going for with this...

local chat = 'This is what will pop up'
local PlayerName = game.Players.LocalPlayer.Name

game.StarterGui:SetCore('ChatMakeSystemMessage', {
    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:

local StarterGui = game:GetService('StarterGui')
local player = game.Players.LocalPlayer

local frame = script.Parent.Parent
local ChatSayer = script.Parent
local thingtoSay = frame.ChatText

ChatSayer.MouseButton1Click:Connect(function()
    StarterGui:SetCore('ChatMakeSystemMessage',
        {
            Text = '[' .. player.Name .. '] ' .. thingtoSay.Text
        }
    )
end)

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

0
not sure what you mean with "How I have my gui set" but here is a screenshot of how it is, and if the gui itself also needs to be screenshotted then i'll include that also https://imgur.com/ND0PGVx RedWirePlatinum 53 — 4y
0
I updated it IDKBlox 349 — 4y
0
turns out all I had to do was make make the local chat's thing be game.Players.LocalPlayer.PlayerGui instead of just game.StarterGui, and also had to move the local chat inside of the button function, thanks for the help though! RedWirePlatinum 53 — 4y
0
You're welcome, glad I could help at least a little! IDKBlox 349 — 4y
Ad

Answer this question