Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
--- Variables --- local ToggleVoteEvent = game.ReplicatedStorage.FoodsSystem.ToggleVoteEvent local AddVoteEvent = game.ReplicatedStorage.FoodsSystem.AddVoteEvent local Button1 = script.Parent.FoodButton1 local Button2 = script.Parent.FoodButton2 local HasVoted = false local VoteFrame = script.Parent local Option1 = game.ReplicatedStorage.FoodsSystem.Food1 local Option2 = game.ReplicatedStorage.FoodsSystem.Food2 --- Toggle Visible --- ToggleVoteEvent.OnClientEvent:Connect(function(Value) if Value == true then VoteFrame.Visible = true elseif Value == false then VoteFrame.Visible = false end end) --- Add Vote --- local function Vote(Button, Option) if HasVoted == false then HasVoted = true Button.BackgroundColor3 = Color3.new(0, 255, 255) AddVoteEvent:FireServer(Option) end end Button1.MouseButton1Click:Connect(function() Vote(Button1, 1) end) Button2.MouseButton1Click:Connect(function() Vote(Button2, 1) end) --- Update Count --- Option1.Changed:Connect(function() Button1.VoteCount.Text = Option1.Value end) Option2.Changed:Connect(function() Button2.VoteCount.Text = Option2.Value end)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)