Advertisement
Guest User

old embed script

a guest
Nov 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. function ExtractNames(t)
  2. local r={}
  3. for _,v in pairs(t) do
  4. table.insert(r,v.Name)
  5. end
  6. return r
  7. end
  8.  
  9. local module = function()
  10. local defendersList = {}
  11. local raidersList = {}
  12. for _, player in pairs(game.Players:GetPlayers()) do
  13. table.insert(player.TeamColor==BrickColor.new("Bright red") and raidersList or defendersList, player)
  14. end
  15. local embed = {
  16. title = "Server Infomation",
  17. description =
  18. "Server `"..game.JobId.."` is currently official.\n"
  19. .."**Raid time remaining: " .. tostring(3600 - workspace.Schaltuhr.Value) .. "**\n"
  20. ..(workspace.Terminal.Controller.Value==BrickColor.new("Bright red")
  21. and "**Terminal time remaining: " .. tostring(workspace.Terminal.Countdown.Timer.Value) .."**\n"
  22. or "Terminal is controlled by Vortex Security.\n"
  23. )
  24. .."\n"
  25. .."**Player counts**\n"
  26. ,
  27. color = 0xE67E22,
  28. footer = {
  29. text = "Direct from server"
  30. },
  31. fields = {
  32. {
  33. name = "Defenders",
  34. value = #defendersList>0 and table.concat(ExtractNames(defendersList),"\n") or "none?",
  35. inline = true
  36. },
  37. {
  38. name = "Raiders",
  39. value = #raidersList>0 and table.concat(ExtractNames(raidersList),"\n") or "none?",
  40. inline = true
  41. }
  42. }
  43. }
  44. print(game.HttpService:JSONEncode(embed))
  45. return embed
  46. end
  47.  
  48. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement