local UIS = game:GetService("UserInputService")
local Voted = {}
local player = game.Players.LocalPlayer.Name
function Update(Update)
if Voted[player] then
print("yep")
else
table.insert(Voted, player)
print(Voted[player])
end
end
UIS.InputBegan:Connect(function(Key)
if Key.KeyCode == Enum.KeyCode.A then
Update("Map1")
elseif Key.KeyCode == Enum.KeyCode.B then
Update("Map2")
end
end)
On the update function, it keeps printing nil on the else statement, even when it has inserted it to the table.

1 comment
table.insert is for arrays, while you seem to want the Voted table to be a dictionary