Advertisement
Sungmingamerpro13

Votes In MainScript

Jun 29th, 2025
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.80 KB | None | 0 0
  1. local VoteRemotes = game.ReplicatedStorage.VoteRemotes
  2. local VoteValues = game.ReplicatedStorage.VoteValues
  3.  
  4. function Voting_System(Time)
  5.     for i = Time,0,-1 do
  6.         VoteValues.Status.Value = i.." Seconds Left To Choose!"
  7.         wait(1)
  8.     end
  9. end
  10.  
  11. function BadgeAward(Id)
  12.     for i,v in pairs(game.Players:GetPlayers()) do
  13.         game:GetService("BadgeService"):AwardBadge(v.UserId, Id)
  14.     end
  15. end
  16.  
  17. --- MainScript ---
  18.  
  19. VoteRemotes.ToggleVoteEvent:FireAllClients(true)
  20. Voting_System(15)
  21. VoteRemotes.ToggleVoteEvent:FireAllClients(false)
  22.  
  23. if VoteValues.Option1.Value > VoteValues.Option2.Value then
  24.     print("Option One Won!")
  25.    
  26.     wait(5)
  27.    
  28.     BadgeAward(2152687115723422)
  29. elseif VoteValues.Option2.Value > VoteValues.Option1.Value then
  30.     print("Option Two Won!")
  31.    
  32.     wait(5)
  33.  
  34.     BadgeAward(2794804832658513)
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement