Advertisement
Sungmingamerpro13

MainScript with 2 Votes (2 Endings)

May 14th, 2025
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.55 KB | None | 0 0
  1. local VotingValues = game.ReplicatedStorage.VotingValues
  2. local votes = {VotingValues.Good, VotingValues.Bad}
  3.  
  4. function VotingSystem(Time)
  5.     VotingValues.VotingOn.Value = true
  6.     for i = Time,0,-1 do
  7.         VotingValues.VotingStatus.Value = i.." Seconds Left To Choose!"
  8.         wait(1)
  9.     end
  10.     VotingValues.VotingOn.Value = false
  11. end
  12.  
  13. wait(5)
  14.  
  15. VotingSystem(15)
  16.  
  17. table.sort(votes, function(A, B)
  18.     return A.Value > B.Value
  19. end)
  20. local chosen = votes[1].Name
  21. if chosen == "Good" then
  22.     print("Good Ending!")
  23. elseif chosen == "Bad" then
  24.     print("Bad Ending!")
  25. end
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement