Advertisement
XxxLloyd061302xxX

Game Script (Not yet Complete)

Jun 27th, 2017
10,061
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. local maps = game.ServerStorage:WaitForChild("Maps"):GetChildren()
  2. local lobby = game.Workspace:WaitForChild("Lobby")
  3. local message = game.Workspace:WaitForChild("Message")
  4. local numplayers = game.Workspace:WaitForChild("NumPlayers")
  5. local chosenmap= game.Workspace:WaitForChild("ChosenMap")
  6. local selected = game.Workspace:WaitForChild("SelectedMap")
  7. local playerNeeded = 1 -- for testing :P
  8.  
  9. function deleteLastMap()
  10. selected:ClearAllChildren()
  11. end
  12.  
  13. function checkPlayers()
  14. if numplayers.Value >= playerNeeded then
  15. return true
  16. else
  17. return false
  18. end
  19. end
  20.  
  21. function getAlivePlayers()
  22. local n = 0
  23. local players = game.Players:GetPlayers()
  24. for i = 1,#players do
  25. if players[i].Settings.AFK.Value ~= false then
  26. if players[i].Character ~= nil then
  27. if players[i].Character.Humanoid.Health ~= 0 then
  28. if players[i].Settings.Playing.Value ~= false then
  29. n = n + 1
  30. end
  31. end
  32. end
  33. end
  34. end
  35. return n
  36. end
  37.  
  38. function getWinners()
  39. local n = 0
  40. local players = game.Players:GetPlayers()
  41. for i = 1,#players do
  42. if players[i].Settings.AFK.Value ~= false then
  43. if players[i].Character ~= nil then
  44. if players[i].Character.Humanoid.Health ~= 0 then
  45. if players[i].Settings.Winners.Value ~= false then
  46. n = n + 1
  47. end
  48. end
  49. end
  50. end
  51. end
  52. return n
  53. end
  54.  
  55. function intermission()
  56. for i = 5,1,-1 do -- 5 is the time
  57. wait(1)
  58. message.Value = "Intermission: "..i.." seconds!"
  59. end
  60. end
  61.  
  62. function choosemap()
  63. message.Value = "Choosing minigame..."
  64. chosenmap.Value = math.random(1,#maps).Name
  65. end
  66.  
  67. function displayChosen()
  68. message.Value = "Minigame Chosen: "..chosenmap.Value.."!"
  69. end
  70.  
  71. function loadMinigame()
  72. message.Value = "Loading map..."
  73. local clone = game:GetService("ServerStorage").Maps:FindFirstChild(chosenmap.Value)
  74. clone:Clone().Parent = workspace
  75. end
  76.  
  77. function startGame()
  78. end
  79.  
  80. while true do
  81. wait()
  82. if checkPlayers() then
  83. intermission()
  84. wait(1)
  85. choosemap()
  86. wait(3)
  87. displayChosen()
  88. wait(2)
  89. loadMinigame()
  90. end
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement