Advertisement
Sungmingamerpro13

VotingSystem with 2 Votes (LocalScript)

May 14th, 2025
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.71 KB | None | 0 0
  1. local VotingValues = game.ReplicatedStorage.VotingValues
  2. local chosen
  3.  
  4. local VotingFrame = script.Parent
  5.  
  6. local function Vote(chosen, Ending)
  7.     VotingValues.VoteEvent:FireServer(chosen, Ending)
  8. end
  9.  
  10. VotingFrame.Good.MouseButton1Click:Connect(function()
  11.     if chosen ~= "Good" then
  12.         Vote(chosen, "Good")
  13.         chosen = "Good"
  14.     end
  15. end)
  16.  
  17. VotingFrame.Bad.MouseButton1Click:Connect(function()
  18.     if chosen ~= "Bad" then
  19.         Vote(chosen, "Bad")
  20.         chosen = "Bad"
  21.     end
  22. end)
  23.  
  24. while wait() do
  25.     VotingFrame.Visible = VotingValues.VotingOn.Value
  26.     VotingFrame.statusLabel.Text = VotingValues.VotingStatus.Value
  27.     VotingFrame.Good.Votes.Text = VotingValues.Good.Value
  28.     VotingFrame.Bad.Votes.Text = VotingValues.Bad.Value
  29. end
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement