Guest User

script

a guest
Aug 26th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.83 KB | None | 0 0
  1. local debounce1 = false
  2.  
  3. if debounce1 == false then
  4. debounce1 = true
  5.  
  6. print(script.Name, "Running")
  7.  
  8. local menuGUI = script.Parent.GameCountDown
  9. local scripts = game.Workspace.theGameStuff.scripts
  10.  
  11. if menuGUI ~= nil then
  12. print("Menu GUI Found")
  13. for i = 0, 2, 1 do
  14. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser"
  15. wait(0.2)
  16. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser."
  17. wait(0.2)
  18. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser.."
  19. wait(0.2)
  20. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser..."
  21. wait(0.2)
  22. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser.."
  23. wait(0.2)
  24. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser."
  25. wait(0.2)
  26. menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser"
  27. wait(0.2)
  28. end
  29. local randomSelectPlayer = true
  30. local playerCount = game.Workspace.PlayerCount.Players
  31.  
  32. if playerCount.Value ~= 0 then
  33. if randomSelectPlayer == true then
  34. local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
  35. print("Selected Button Presser: ", randomPlayer)
  36. if randomPlayer.Character then
  37. randomPlayer.Character:MoveTo(Vector3.new(-9.4, 26.5, 48.2))
  38. end
  39. game.Workspace.Values.buttonPresserName.Value = randomPlayer.Name
  40. randomSelectPlayer = false
  41. end
  42. elseif playerCount.Value == 0 then
  43. print("No players in game")
  44. end
  45.  
  46. local buttonPresserName = game.Workspace.Values.buttonPresserName.Value
  47. print("Button Selecter: ", buttonPresserName)
  48. menuGUI.Frame.Frame.TextLabel.Text = "Button Presser: ".. buttonPresserName
  49. scripts.buttonPresserSelect.Disabled = true
  50. wait(2)
  51. for i = 0, 1, 1 do
  52. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events"
  53. wait(0.2)
  54. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events."
  55. wait(0.2)
  56. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events.."
  57. wait(0.2)
  58. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events..."
  59. wait(0.2)
  60. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events.."
  61. wait(0.2)
  62. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events."
  63. wait(0.2)
  64. menuGUI.Frame.Frame.TextLabel.Text = "Picking Events"
  65. wait(0.2)
  66. end
  67. local fall1 = game.Workspace.storage.eventImages.fall1--platform fall by 1 increment picture
  68. local fall5 = game.Workspace.storage.eventImages.fall5--platform fall by 5 increments picture
  69. local rise5 = game.Workspace.storage.eventImages.rise5--platform rise by 5 increments picture
  70.  
  71. local panel1 = game.Workspace.theGameStuff.eventPanels.eventPanel1
  72. local panel2 = game.Workspace.theGameStuff.eventPanels.eventPanel2
  73. local panel3 = game.Workspace.theGameStuff.eventPanels.eventPanel3
  74.  
  75. local panel1Selected = false
  76. local panel2Selected = false
  77. local panel3Selected = false
  78.  
  79. local event1Selected = false
  80. local event2Selected = false
  81. local event3Selected = false
  82.  
  83. local eventStartCount = 1
  84. local eventAmount = 3--amount of events
  85. local eventName = ""
  86.  
  87. local loopCount = 1
  88.  
  89. while eventStartCount <= 3 do
  90.  
  91. local randEvent = math.random(1, eventAmount)--random number to pick event
  92. local randPanel = math.random(1, 3)--random number to pick which panel to display event
  93.  
  94. if randEvent == 1 then
  95. eventName = "fall1"
  96. elseif randEvent == 2 then
  97. eventName = "fall5"
  98. elseif randEvent == 3 then
  99. eventName = "rise5"
  100. end
  101.  
  102. print("Random Event ", loopCount, ": ", eventName)
  103. print("Random Panel ", loopCount, ": ", randPanel)
  104.  
  105. if randPanel == 1 and panel1Selected == false then--if the random panel number happens to be 1 and if the panel1 isnt being used
  106. if randEvent == 1 and event1Selected == false then
  107. panel1.SurfaceGui.ImageLabel.Image = fall1.Texture
  108. event1Selected = true
  109. panel1Selected = true --tell the script panel1 was selected
  110. eventStartCount = eventStartCount + 1
  111. game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 1
  112. elseif randEvent == 2 and event2Selected == false then
  113. panel1.SurfaceGui.ImageLabel.Image = fall5.Texture
  114. event2Selected = true
  115. panel1Selected = true --tell the script panel1 was selected
  116. eventStartCount = eventStartCount + 1
  117. game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 2
  118. elseif randEvent == 3 and event3Selected == false then
  119. panel1.SurfaceGui.ImageLabel.Image = rise5.Texture
  120. event3Selected = true
  121. panel1Selected = true --tell the script panel1 was selected
  122. eventStartCount = eventStartCount + 1
  123. game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 3
  124. end
  125. end
  126.  
  127. if randPanel == 2 and panel2Selected == false then--if the random panel number happens to be 2 and if the panel2 isnt being used
  128. if randEvent == 1 and event1Selected == false then
  129. panel2.SurfaceGui.ImageLabel.Image = fall1.Texture
  130. event1Selected = true
  131. panel2Selected = true --tell the script panel2 was selected
  132. eventStartCount = eventStartCount + 1
  133. game.Workspace.theGameStuff.buttonRoom.Buttons.Button2.EventValue.Value = 1
  134. elseif randEvent == 2 and event2Selected == false then
  135. panel2.SurfaceGui.ImageLabel.Image = fall5.Texture
  136. event2Selected = true
  137. panel2Selected = true --tell the script panel2 was selected
  138. eventStartCount = eventStartCount + 1
  139. game.Workspace.theGameStuff.buttonRoom.Buttons.Button2.EventValue.Value = 2
  140. elseif randEvent == 3 and event3Selected == false then
  141. panel2.SurfaceGui.ImageLabel.Image = rise5.Texture
  142. event3Selected = true
  143. panel2Selected = true --tell the script panel2 was selected
  144. eventStartCount = eventStartCount + 1
  145. game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 3
  146. end
  147. end
  148.  
  149. if randPanel == 3 and panel3Selected == false then--if the random panel number happens to be 3 and if the panel3 isnt being used
  150. if randEvent == 1 and event1Selected == false then
  151. panel3.SurfaceGui.ImageLabel.Image = fall1.Texture
  152. event1Selected = true
  153. panel3Selected = true --tell the script panel3 was selected
  154. eventStartCount = eventStartCount + 1
  155. game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 1
  156. elseif randEvent == 2 and event2Selected == false then
  157. panel3.SurfaceGui.ImageLabel.Image = fall5.Texture
  158. event2Selected = true
  159. panel3Selected = true --tell the script panel3 was selected
  160. eventStartCount = eventStartCount + 1
  161. game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 2
  162. elseif randEvent == 3 and event3Selected == false then
  163. panel3.SurfaceGui.ImageLabel.Image = rise5.Texture
  164. event3Selected = true
  165. panel3Selected = true --tell the script panel3 was selected
  166. eventStartCount = eventStartCount + 1
  167. game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 3
  168. end
  169. end
  170.  
  171. loopCount = loopCount + 1
  172. wait()
  173. end
  174.  
  175. menuGUI.Frame.Frame.TextLabel.Text = "Events Selected"
  176. wait(1)
  177. local platform = game.Workspace.theGameStuff.gamePlatform:GetChildren()
  178.  
  179. local b1 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button1
  180. local b2 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button2
  181. local b3 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button3
  182. if b1.EventValue.Value == 1 then
  183. b1.ClickDetector.MouseClick:Connect(function()
  184. for i = 1, #platform do
  185. platform[i].Anchored = true
  186. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
  187. end
  188. end)
  189. end
  190. if b1.EventValue.Value == 2 then
  191. b1.ClickDetector.MouseClick:Connect(function()
  192. for i = 1, #platform do
  193. platform[i].Anchored = true
  194. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
  195. end
  196. end)
  197. end
  198. if b1.EventValue.Value == 3 then
  199. b1.ClickDetector.MouseClick:Connect(function()
  200. for i = 1, #platform do
  201. platform[i].Anchored = true
  202. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
  203. end
  204. end)
  205. end
  206. if b2.EventValue.Value == 1 then
  207. b2.ClickDetector.MouseClick:Connect(function()
  208. for i = 1, #platform do
  209. platform[i].Anchored = true
  210. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
  211. end
  212. end)
  213. end
  214. if b2.EventValue.Value == 2 then
  215. b2.ClickDetector.MouseClick:Connect(function()
  216. for i = 1, #platform do
  217. platform[i].Anchored = true
  218. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
  219. end
  220. end)
  221. end
  222. if b2.EventValue.Value == 3 then
  223. b2.ClickDetector.MouseClick:Connect(function()
  224. for i = 1, #platform do
  225. platform[i].Anchored = true
  226. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
  227. end
  228. end)
  229. end
  230. if b3.EventValue.Value == 1 then
  231. b3.ClickDetector.MouseClick:Connect(function()
  232. for i = 1, #platform do
  233. platform[i].Anchored = true
  234. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
  235. end
  236. end)
  237. end
  238. if b3.EventValue.Value == 2 then
  239. b3.ClickDetector.MouseClick:Connect(function()
  240. for i = 1, #platform do
  241. platform[i].Anchored = true
  242. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
  243. end
  244. end)
  245. end
  246. if b3.EventValue.Value == 3 then
  247. b3.ClickDetector.MouseClick:Connect(function()
  248. for i = 1, #platform do
  249. platform[i].Anchored = true
  250. platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
  251. end
  252. end)
  253. end
  254. local buttonPressCount = 10
  255. while buttonPressCount >= 0 do
  256. menuGUI.Frame.Frame.TextLabel.Text = "Waitiing for button presser: ".. buttonPressCount
  257. buttonPressCount = buttonPressCount - 1
  258. wait(0.9)
  259. end
  260. end
  261.  
  262. end
Advertisement
Add Comment
Please, Sign In to add comment