I'd like multiple messages to pop up randomly on the roblox chat GUI not sure how to do this can anyone help?
Resource(s) Used In My Answer: SetCore - Roblox Wiki
Answer to Your Question: You're going to want to start by creating a localscript inside of StarterPack. This is how we can access SetCore, which is part of the StarterGui. Here's your script:
math.randomseed(tick()*wait()) -- This ensures random numbers, and is used for math.random() later on. local messagesToDisplay = { -- Inserts messages into here "[GAME]: Remember to thumbs up the game!", "[GAME]: Remember to favorite the game!" }; local minTimeToWait = 60 -- What's the minimum wait time? local maxTimeToWait = 300 -- What's the maximum wait time? while wait(math.random(minTimeToWait, maxTimeToWait)) do local randomText = messagesToDisplay[math.random(1,#messagesToDisplay)] -- We'll get a random number between 1 and the total of all messages in the table and use that to find a random message. game.StarterGui:SetCore("ChatMakeSystemMessage", { Text = "randomText!"; -- Required. Has to be a string! Color = Color3.new(0, 1, 1); -- Cyan is (0, 255 / 255, 255 / 255). Optional, defaults to white: Color3.new(255 / 255, 255 / 255, 243 / 255) Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18 }) end end
Conclusion: Using math.random(), SetCore, and other important Lua/RBXLua features you can create a script that will randomly put out a message to the player every 60 - 300 seconds (obviously the numbers can be changed). I hope I helped you! :)