Player:GetWeapons() seems to return an nil entities after dropping a weapon in DarkRP.

I am making a weapon selection menu.
When i do /dropweapon, Player:GetWeapons() will return a nil in the place of that weapon.

What it looks like:
http://steamcommunity.com/sharedfiles/filedetails/?id=201361728 // Before
http://steamcommunity.com/sharedfiles/filedetails/?id=201361957 // After

Code: http://pastebin.com/sCqXSJ6K (It’s a bit ugly)

Before drawing the weapons, loop through the table and remove the invalid weapons.

i tried that before, i think the table still had a wrong count. I was using table.remove()
And anyways, then i couldnt use Player:SelectWeapon() :c

Have you looked into how TTT handles this?

Seems ttt work another way

[editline]7th December 2013[/editline]

You mean to check the valid weapon or not then remove it or what?

[LUA]
for k, v in pairs(src) do
if IsValid(v) then
table.insert(dest, v)
end
end
[/LUA]