String Value becomes numbers

You can write your topic however you want, but you need to answer these questions:

  1. I want to use String Value that is always same.
  2. 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

When you are going to use :FireServer(), you don’t have to put the Player on the first argument. Change it to SendVote:FireServer("Third")

1 Like

The problem I need that Player, so I can send another remote back and get the value from player

But as I said, you don’t have to send the Player through :FireServer(), when you do .OnServerEvent the server already gets Player as the first argument even if you are not sending it from the client

1 Like

Yup, That was a problem, Wonder why it was giving numbers. Thank You!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.