Training Announcements

So the text I want displayed goes in body?

Yes, it goes in Title and Body.

So for BAE I just have to wait?

Yep you will have to wait if you don’t have any other way of accessing it.

As @yelnastz gave you the code with wait(value) and remoteEvent:FireAllClients, I have a tip for you. When inserting the number in wait, please run your text through the m/message command and check for the time it shows on the left of the message’s title bar. You may insert that number for the wait(value) so it can be smooth and does not cut off.

The timer will be different for each text, depending on its length.

2 Likes

I did find another way that does work and it is a plugin.

local Plugin = function(…)
local Data = {…}

– Included Functions and Info –
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8]

– Plugin Configuration –
local pluginName = ‘starttraining’
local pluginPrefix = Prefix
local pluginLevel = 2
local pluginUsage = “”
local pluginDescription = “Triggers a series of training messages.”

– Example Plugin Function –
local function pluginFunction(Args)
local Player = Args[1]

  remoteEvent:FireClient(Player, 'Message', '[TITLE]', '[ANNOUNCEMENT]') 
  wait(15) 
  remoteEvent:FireClient(Player, 'Message', '[TITLE]', '[ANNOUNCEMENT]') 
  wait(15) 
  remoteEvent:FireClient(Player, 'Message', '[TITLE]', '[ANNOUNCEMENT].') 
  wait(15) 
  remoteEvent:FireClient(Player, 'Message', '[TITLE]', '[ANNOUNCEMENT]') 

end

– Return Everything to the MainModule –
local descToReturn
if pluginUsage ~= “” then
descToReturn = pluginPrefix…pluginName…’ ‘…pluginUsage…’\n’…pluginDescription
else
descToReturn = pluginPrefix…pluginName…‘\n’…pluginDescription
end
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}

end
return Plugin

That’s practically the same with some added bits. Also, make sure you’re going to use FireAllClients(), not FireClient().

I am having trouble with one part that I tried to make it link to if there is a host/ and or co host it will put there names so this is what I have but when I trigger the command the message is blank.

local function pluginFunction(Args)
local Player = Args[1]
local message = “”
if hostName ~= “” and coHostName ~= “” then
message = “Welcome to Cafe G’s training program! I am your host “…hostName…”, with your co-host “…coHostName…”. We will be starting now.”
elseif hostName ~= “” then
message = “Welcome to Cafe G’s training program! I am your host “…hostName…”. We will be starting now.”
end
remoteEvent:FireAllClients(Player, ‘Message’, ‘Lobby Announcements’, message)
wait(3)
remoteEvent:FireAllClients(Player, ‘Message’, ‘Training Rules’, ‘Please listen to the trainers instructions during this session.’)
wait(15)
remoteEvent:FireAllClients(Player, ‘Message’, ‘Training Rules’, ‘Use correct grammar to pass this training.’)
wait(15)
remoteEvent:FireAllClients(Player, ‘Message’, ‘Training Tips’, ‘Be respectful to other trainees and trainers.’)
wait(15)
remoteEvent:FireAllClients(Player, ‘Message’, ‘Training Tips’, ‘Ask questions if you are unsure about something.’)
end

I don’t think you will be able to achive this via a plugin- only the MainModule.

Oh. Would that be complicated?

If you don’t know how to code well enough, then yes.

Ah, yeah I don’t know how to code well at all.

sorry for coming in but using wait() is very bad practice as wait() is deprecated and is extremely unoptimized - you should use task.wait() instead
i’ll not go into about why, you can read that here: Should I use Wait() or Task.Wait() - Scripting Support - Developer Forum | Roblox

i know i only replied to you but this message is also intended to be read by @emeraldaltb and @justhimnoah since the code and the explanations they provided in this thread also use wait() instead of task.wait()

2 Likes

What did work is I was able to make it so it uses the user who ran the command because per our handbook the Host would run it so the co host just won’t be included.

local Plugin = function(…)
local Data = {…}

– Included Functions and Info
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8]

– Plugin Configuration
local pluginName = ‘starttraining’
local pluginPrefix = Prefix
local pluginLevel = 2
local pluginUsage = “” – Allow username to be inserted
local pluginDescription = “Triggers a series of training messages.”

– Example Plugin Function
local function pluginFunction(Args)
local Player = Args[1]
local User = Player.Name – Get the username of the player who ran the script

  remoteEvent:FireClient(Player, 'Message', 'Lobby Announcements', 'Welcome to Cafe G training program! I am your host ' ..User.. '. We will be starting now.')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'Lobby Announcements', 'I will now present to you the logistics and rules of this training session. Please pay attention and listen; talking or jumping around will have you kicked from the server.')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'SESSION RULES', 'Please listen to your trainers at all times during the training session. Not doing so will result in removal from the server and automatic fail.')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'SESSION RULES', 'TBD')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'SESSION RULES', 'Do not leave the server before being dismissed by the Host or Co-Host, or your training will be voided.')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'Training Structure', 'Now, here is how todays session will go down:')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'Training Structure', 'First, everyone will begin the Theory test. This will test your knowledge about the mechanics of how to behave as a Staff Member here at Cafe G.')
  wait(15)
  remoteEvent:FireClient(Player, 'Message', 'Training Structure', 'Theory will be composed of 6 questions, each with 4 choices of answers. In order to pass this test, you must get at least 4 out of 6 questions correctly. Passing theory will grant you 1 point.')

end

– Return Everything to the MainModule
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}

end

return Plugin

(Script if anyone wants it)

But I am having trouble with “remoteEvent:FireAllClients”

How come? Whats the problem

Won’t display on the screen when I add that it breaks.

Show me what your putting for the script when you add FireAllClients

local Plugin = function(…)
local Data = {…}

– Included Functions and Info
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8]

– Plugin Configuration
local pluginName = ‘starttraining’
local pluginPrefix = Prefix
local pluginLevel = 2
local pluginUsage = “{username}” – Allow username to be inserted
local pluginDescription = “Triggers a series of training messages.”

– Example Plugin Function
local function pluginFunction(Args)
print(“Plugin function started”)
local Player = Args[1]
print(“Player:”, Player.Name)
local Username = Player.Name – Get the username of the player who ran the script
print(“Username:”, Username)

  -- Broadcast messages to all players
  print("Broadcasting messages to all players")
  remoteEvent:FireAllClients(nil, 'Message', 'Lobby Announcements', 'Welcome to Cafe G training program! I am your host ' .. Username .. '. We will be starting now.')
  wait(10)
  print("Message 1 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'Lobby Announcements', 'I will now present to you the logistics and rules of this training session. Please pay attention and listen; talking or jumping around will have you kicked from the server.')
  wait(15)
  print("Message 2 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'SESSION RULES', 'Please listen to your trainers at all times during the training session. Not doing so will result in removal from the server and automatic fail.')
  wait(15)
  print("Message 3 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'SESSION RULES', 'TBD')
  wait(15)
  print("Message 4 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'SESSION RULES', 'Do not leave the server before being dismissed by the Host or Co-Host, or your training will be voided.')
  wait(15)
  print("Message 5 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'Training Structure', 'Now, here is how todays session will go down:')
  wait(15)
  print("Message 6 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'Training Structure', 'First, everyone will begin the Theory test. This will test your knowledge about the mechanics of how to behave as a Staff Member here at Cafe G.')
  wait(15)
  print("Message 7 sent")
  remoteEvent:FireAllClients(nil, 'Message', 'Training Structure', 'Theory will be composed of 6 questions, each with 4 choices of answers. In order to pass this test, you must get at least 4 out of 6 questions correctly. Passing theory will grant you 1 point.')
  print("Plugin function finished")

end

– Return Everything to the MainModule
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}

end

return Plugin

You dont need the nil replace it with this:

remoteEvent:FireAllClients('Message', 'Training Structure', 'Now, here is how todays session will go down:')