Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local debounce1 = false
- if debounce1 == false then
- debounce1 = true
- print(script.Name, "Running")
- local menuGUI = script.Parent.GameCountDown
- local scripts = game.Workspace.theGameStuff.scripts
- if menuGUI ~= nil then
- print("Menu GUI Found")
- for i = 0, 2, 1 do
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser"
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser.."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser..."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser.."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Selecting Button Presser"
- wait(0.2)
- end
- local randomSelectPlayer = true
- local playerCount = game.Workspace.PlayerCount.Players
- if playerCount.Value ~= 0 then
- if randomSelectPlayer == true then
- local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
- print("Selected Button Presser: ", randomPlayer)
- if randomPlayer.Character then
- randomPlayer.Character:MoveTo(Vector3.new(-9.4, 26.5, 48.2))
- end
- game.Workspace.Values.buttonPresserName.Value = randomPlayer.Name
- randomSelectPlayer = false
- end
- elseif playerCount.Value == 0 then
- print("No players in game")
- end
- local buttonPresserName = game.Workspace.Values.buttonPresserName.Value
- print("Button Selecter: ", buttonPresserName)
- menuGUI.Frame.Frame.TextLabel.Text = "Button Presser: ".. buttonPresserName
- scripts.buttonPresserSelect.Disabled = true
- wait(2)
- for i = 0, 1, 1 do
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events"
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events.."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events..."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events.."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events."
- wait(0.2)
- menuGUI.Frame.Frame.TextLabel.Text = "Picking Events"
- wait(0.2)
- end
- local fall1 = game.Workspace.storage.eventImages.fall1--platform fall by 1 increment picture
- local fall5 = game.Workspace.storage.eventImages.fall5--platform fall by 5 increments picture
- local rise5 = game.Workspace.storage.eventImages.rise5--platform rise by 5 increments picture
- local panel1 = game.Workspace.theGameStuff.eventPanels.eventPanel1
- local panel2 = game.Workspace.theGameStuff.eventPanels.eventPanel2
- local panel3 = game.Workspace.theGameStuff.eventPanels.eventPanel3
- local panel1Selected = false
- local panel2Selected = false
- local panel3Selected = false
- local event1Selected = false
- local event2Selected = false
- local event3Selected = false
- local eventStartCount = 1
- local eventAmount = 3--amount of events
- local eventName = ""
- local loopCount = 1
- while eventStartCount <= 3 do
- local randEvent = math.random(1, eventAmount)--random number to pick event
- local randPanel = math.random(1, 3)--random number to pick which panel to display event
- if randEvent == 1 then
- eventName = "fall1"
- elseif randEvent == 2 then
- eventName = "fall5"
- elseif randEvent == 3 then
- eventName = "rise5"
- end
- print("Random Event ", loopCount, ": ", eventName)
- print("Random Panel ", loopCount, ": ", randPanel)
- if randPanel == 1 and panel1Selected == false then--if the random panel number happens to be 1 and if the panel1 isnt being used
- if randEvent == 1 and event1Selected == false then
- panel1.SurfaceGui.ImageLabel.Image = fall1.Texture
- event1Selected = true
- panel1Selected = true --tell the script panel1 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 1
- elseif randEvent == 2 and event2Selected == false then
- panel1.SurfaceGui.ImageLabel.Image = fall5.Texture
- event2Selected = true
- panel1Selected = true --tell the script panel1 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 2
- elseif randEvent == 3 and event3Selected == false then
- panel1.SurfaceGui.ImageLabel.Image = rise5.Texture
- event3Selected = true
- panel1Selected = true --tell the script panel1 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button1.EventValue.Value = 3
- end
- end
- if randPanel == 2 and panel2Selected == false then--if the random panel number happens to be 2 and if the panel2 isnt being used
- if randEvent == 1 and event1Selected == false then
- panel2.SurfaceGui.ImageLabel.Image = fall1.Texture
- event1Selected = true
- panel2Selected = true --tell the script panel2 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button2.EventValue.Value = 1
- elseif randEvent == 2 and event2Selected == false then
- panel2.SurfaceGui.ImageLabel.Image = fall5.Texture
- event2Selected = true
- panel2Selected = true --tell the script panel2 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button2.EventValue.Value = 2
- elseif randEvent == 3 and event3Selected == false then
- panel2.SurfaceGui.ImageLabel.Image = rise5.Texture
- event3Selected = true
- panel2Selected = true --tell the script panel2 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 3
- end
- end
- if randPanel == 3 and panel3Selected == false then--if the random panel number happens to be 3 and if the panel3 isnt being used
- if randEvent == 1 and event1Selected == false then
- panel3.SurfaceGui.ImageLabel.Image = fall1.Texture
- event1Selected = true
- panel3Selected = true --tell the script panel3 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 1
- elseif randEvent == 2 and event2Selected == false then
- panel3.SurfaceGui.ImageLabel.Image = fall5.Texture
- event2Selected = true
- panel3Selected = true --tell the script panel3 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 2
- elseif randEvent == 3 and event3Selected == false then
- panel3.SurfaceGui.ImageLabel.Image = rise5.Texture
- event3Selected = true
- panel3Selected = true --tell the script panel3 was selected
- eventStartCount = eventStartCount + 1
- game.Workspace.theGameStuff.buttonRoom.Buttons.Button3.EventValue.Value = 3
- end
- end
- loopCount = loopCount + 1
- wait()
- end
- menuGUI.Frame.Frame.TextLabel.Text = "Events Selected"
- wait(1)
- local platform = game.Workspace.theGameStuff.gamePlatform:GetChildren()
- local b1 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button1
- local b2 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button2
- local b3 = game.Workspace.theGameStuff.buttonRoom.Buttons.Button3
- if b1.EventValue.Value == 1 then
- b1.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
- end
- end)
- end
- if b1.EventValue.Value == 2 then
- b1.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
- end
- end)
- end
- if b1.EventValue.Value == 3 then
- b1.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
- end
- end)
- end
- if b2.EventValue.Value == 1 then
- b2.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
- end
- end)
- end
- if b2.EventValue.Value == 2 then
- b2.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
- end
- end)
- end
- if b2.EventValue.Value == 3 then
- b2.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
- end
- end)
- end
- if b3.EventValue.Value == 1 then
- b3.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 1, platform[i].CFrame.Z)
- end
- end)
- end
- if b3.EventValue.Value == 2 then
- b3.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y - 5, platform[i].CFrame.Z)
- end
- end)
- end
- if b3.EventValue.Value == 3 then
- b3.ClickDetector.MouseClick:Connect(function()
- for i = 1, #platform do
- platform[i].Anchored = true
- platform[i].CFrame = CFrame.new(platform[i].CFrame.X, platform[i].CFrame.Y + 5, platform[i].CFrame.Z)
- end
- end)
- end
- local buttonPressCount = 10
- while buttonPressCount >= 0 do
- menuGUI.Frame.Frame.TextLabel.Text = "Waitiing for button presser: ".. buttonPressCount
- buttonPressCount = buttonPressCount - 1
- wait(0.9)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment