Squanou

WelcomeOnServer

Jun 23rd, 2024
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local playerDetector = peripheral.find("playerDetector")
  2. local chatBox = peripheral.find("chatBox")
  3.  
  4. if playerDetector == nil then
  5.     error("Aucun dététeur de joueurs disponible.")
  6.     return
  7. end
  8.  
  9. if chatBox == nil then
  10.     error("Aucun chatBox disponible.")
  11.     return
  12. end
  13.  
  14. local event, username, dimension = os.pullEvent("playerJoin")
  15.  
  16. local messageS = {
  17.     { text = "Bienvenue " .. username .. " sur le serveur FTB StoneBlock 3 entre coupin ! :eyes:" }
  18. }
  19.  
  20. local json = textutils.serialiseJSON(message)
  21.  
  22. local success = chatBox.sendFormattedMessage(json, "TsykiBase", nil)
Advertisement
Add Comment
Please, Sign In to add comment