I’ve been receiving the output from my little server script and it just seems impossible what I’m getting. I’ve printed out nearly everything to just prove the fact that it has the player in the table, it identifies the player from the function, but the table.find() function is returning a nil value - as if its not in the table at all, as if it isn’t indexed at all. How? Why?
Code :
Players.PlayerRemoving:connect(function(player)
print(Dueling) -- Dueling table
print(player) -- The player that disconnected
local dude = table.find(Dueling, player) -- Finding index of disconnected player
print(dude) -- Check the index ( for some reason always nil )
if dude == nil then -- if dude is not in Dueling table, he is Participant
print("Participants")
else -- if he is in the index, hes a dueler.
print("Dueling, i don't know")
end end)
Output :
22:31:09.564 ▼ {
[1] = “Player1”, – this is the dueling table
[2] = “Player2”
} - Server - main:23
22:31:09.564 Player1 - Server - main:24 – this is the player that disconnected
22:31:09.564 nil - Server - main:26 – this is trying to find the index of the player
22:31:09.564 Participants - Server - main:28 – this is the if statement return
Please any help at all with this topic is greatly appreciated as its really halted a lot of progress on the game.