Sungmingamerpro13

Voting System 3 (STORY GAME)

Sep 9th, 2025
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.67 KB | None | 0 0
  1. VotingValues.VoteEvent.OnServerEvent:Connect(function(player, previous, chosen)
  2.     local votes = VotingValues[chosen]
  3.     votes.Value = votes.Value + 1
  4.     if previous ~= nil then
  5.         local prev = VotingValues[previous]
  6.         prev.Value = prev.Value - 1
  7.     end
  8. end)
  9.  
  10. VotingValues.VotingOn.Value = false
  11.  
  12. wait(5)
  13.  
  14. VotingValues.VotingOn.Value = true
  15.  
  16. for i = 15,0,-1 do
  17.     VotingValues.VotingStatus.Value = i.." Seconds Left to chosen!"
  18.     wait(1)
  19. end
  20. local votes = {VotingValues.Good, VotingValues.Bad}
  21. table.sort(votes, function(a, b)
  22.     return a.Value > b.Value
  23. end)   
  24. local chosen = votes[1].Name
  25. if chosen == "Good" then
  26.     print("Good Ending!")
  27. else
  28.     print("Bad Ending!")
  29. end
Advertisement
Add Comment
Please, Sign In to add comment