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

How do I make a chat appear on the chatbox?

Asked by 3 years ago

I want a text to appear by a chatbox. I DONT MEAN BY THIS

game.Chat:Chat()

Can you please help? Well, I don't know what to do so thats why theres no code.

0
Do you mean like making an npc chat, making a player chat, or making a custom chat? Omq_ItzJasmin 666 — 3y
0
I mean I want it to show in chatbox when you hit the chat button. tamasjonas 62 — 3y
0
So you mean like a gui...when a player enters input and press "chat", it shows up as actual chat? Omq_ItzJasmin 666 — 3y
0
Oh, your chatbox is broken. They only way you could have done that is by literally going into chat settings and either disabling whatever it would be or deleted a script. Sorry, but I don't know how to help. Mr_Weasel1 0 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

I have a fix and I would appreciate it if you could also fix my problems(on my scripting helpers profile)

CLIENT SETUP

WITH CLIENT SETUP EVERY PLAYER WILL SEE A DIFFRENT MESSAGE

To do on client put this code in a local script in StarterPlayerScripts:

while true do

    local WaitTime = math.random(30,60) --wait time randomiser

    local Chat = {                                         --Text to be used(list of possible chat msgs)
        "[System Message] Hello",
        "[System Message] Remember to like this game",
        "[System Message] Are you enjoying?"
    }

    local randommsgs = Chat[math.random(1, #Chat)]

    game.StarterGui:SetCore( "ChatMakeSystemMessage", 

        { Text = randommsgs, 

            Color = Color3.fromRGB( 255,0,0 ), --Coulor to be used

            Font = Enum.Font.Arial, --Font to be used

            FontSize = Enum.FontSize.Size24 } ) --Text size

    wait(WaitTime) --Waits the vale of w seconds between each message

end
0
with this one it only shows in chat box tommymcoco1 39 — 3y
0
Here is your 20 reputation. tamasjonas 62 — 3y
0
thanks tommymcoco1 39 — 3y
Ad
Log in to vote
0
Answered by
TGazza 1336 Moderation Voter
3 years ago

The correct syntax for using Chat() is as follows:

local Mouth = game:GetService("Chat") -- Lolz
local Players = game:GetService("Players")
local ind = 1

local Speaker = Instance.new("Part",workspace)

Players.PlayerAdded:Connect(function(plr) 
    while plr.Character == nil do
        print("Waiting"..string.rep(".",ind))
        if(plr.Character ~= nil) then wait(1) break end
        wait()
        ind = ind+1 < 4 and ind +1 or 1
    end
    Mouth:Chat(Speaker,"Hai!, "..plr.Name.."!!1!!") -- Say Hai!
end)

The only way this will work is you need to have the chat box open, so it won't work in run mode only in play mode. Also, it will only appear as a chat bubble and NOT in the chat box, I'm not sure if it is possible to do that from client/server side scripts.

Answer this question