ServerMessage script problem

Hello!I writing script and he is not work

game:GetService('Chat'):Message("your message here")
wait(30)
game:GetService("Chat"):Clone("your message here")
wait(3 * 60)
game:GetService("Chat"):Clone("your message here")
Color = Enum.ChatColor.Blue

What’s wrong with him?
By the way,its localscript and im put in Chat

You’re trying to clone the actual service itself? Do you mean to repeat the same message over and over?

Might wanna look at this

--In a LocalScript
local ChatService = game:GetService("Chat")
local PartToReference = workspace:WaitForChild("PartNameHere")

ChatService:Chat(PartToReference, "Your Message Here", "Blue")
wait(30)
ChatService:Chat(PartToReference, "Your Message Here", "Blue")
wait(3 * 60)
ChatService:Chat(PartToReference, "Your Message Here", "Blue")

This is just a test, I want it to repeat different messages

You could just simply use a table for that, which can hold multiple values (Or messages from your perspective)

You can also do math.random(), which will take a randomized number from the total amount given (Or a random message from our message table)

local Duration = 30
local ChatService = game:GetService("Chat")
local PartToReference = workspace:WaitForChild("PartNameHere")

local MessagesToSay = {
    "Message 1",
    "Message 2",
    "Message 3",
    "Potato"
}

while true do
    local RandomMessage = MessagesToSay[math.random(#MessagesToSay)]

    ChatService:Chat(PartToReference, RandomMessage, "Blue")
    wait(Duration)
end

Wait, do I need to insert this into Chat?

I just gave a reference, do keep in mind that you should take consideration into looking at the Dev API & other answers on the Forum :wink:

Haha, sorry, I’m in a hurry all the time! :sweat_smile:

Don’t worry about it, it’s all good

If you do have anymore questions feel free to ask!

local PartToReference = workspace:WaitForChild("PartNameHere")

Have a question what to do with this line?

That’s just simply the Part you want to chat with that’s inside your workspace (Or an Instance which is basically an object)

1 Like

I decided to try this script, only it doesn’t work!

--In a LocalScript
local ChatService = game:GetService("Chat")
local PartToReference = workspace:WaitForChild("PartNameHere")

ChatService:Chat(PartToReference, "Follow ItsDontM!", "Gold")
wait(30)
ChatService:Chat(PartToReference, "Like and Follow the game!", "Gold")
wait(3 * 60)
ChatService:Chat(PartToReference, "Thanks Jackscarlett for the script! ", "Gold")

The thing is that, this uses ROBLOX’s old OLD Chat Service so you’re only limited to using 3 colors (Red, Green, and Blue)

Also I do believe that if you’re using a LocalScript you have to put it inside StarterPlayerScripts for it to properly work

I think using a Server Script can work as well? Just be sure to place it in either the workspace or ServerScriptService

1 Like