You can write your topic however you want, but you need to answer these questions:
- I want to use String Value that is always same.
- The Vote value, that is string, becomes numbers when printed
SendVote.OnServerEvent:Connect(function(Player, Vote)
print(Vote, Player.Data.Voted.Value)
if Vote == "First" and Player.Data.Voted.Value ~= Vote then
print("1")
if Player.Data.Voted.Value ~= "no" then
if Player.Data.Voted.Value == "Third" then
Third -= 1
elseif Player.Data.Voted.Value == "Second" then
Second -= 1
end
end
Player.Data.Voted.Value = "First"
First += 1
UpdateVote:FireClient(Player, First, Second, Third)
Part of code that uses remote and asks for Vote. Here Vote is printed.
local Button = script.Parent
local SendVote = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("SendVote")
Button.MouseButton1Down:Connect(function(Player)
SendVote:FireServer(Player, "Third")
end)
One of Codes that gives values and calls remote.
First is a player, the second is Vote Variable.
14:45:07.512 ▶ 223 no (x2) - Server - Voting:10
14:45:08.279 ▶ 643 no (x2) - Server - Voting:10
14:45:08.895 ▶ 1026 no (x2) - Server - Voting:10
And thats an output