All table indexes suddenly becomes nil

Hey! so theres a local script in my game that i use to handle some things and in it theres a table in that has all the players ingame, but for some reason everything in that table is becoming nil

Can anyone help me fix that?

The Script

local plrlist = {}

for i,v in pairs(game:GetService("Players"):GetPlayers()) do 
		if v ~= game.Players.LocalPlayer then 
			table.insert(plrlist, v.Name)
		end
	end

	game.Players.PlayerAdded:Connect(function(v)
		if v.Name ~= lplr.Name and not table.find(plrlist, v.Name) then
			table.insert(plrlist, v.Name)
		end
	end)

	game.Players.PlayerRemoving:Connect(function(v)
		if table.find(plrlist, v.Name) then
			table.remove(plrlist, table.find(plrlist, v.Name))
		end
	end)

I used to have a similar problem like yours, and it’s because for some unknown reason, the events were not fired. To test it fully, you should publish your game and play it in a real Roblox game of it to test full capabilities.

I tested it in a real roblox game and it also didnt work, its a kinda weird issue

Try print statements to confirm if the events and for loops are firing.

Yeah ima try that
sussycharacters