Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't this script working when I have made sure to triple check?

I got this in output..

ServerScriptService.MainScript:105: bad argument #1 to 'remove' (table expected, got nil)

So this is line 105:

table.remove(plrs.x)

and these are the lines AROUND line 105

-- They are still alive
					print(player.Name.." is still in the game!")
				else
					--They are dead
					table.remove(plrs.x)
					print(player.Name.." has been killed!")
				end
			end

is there a reason for the output saying what it says?

1 comment

1 answer

-- They are still alive
                    print(player.Name.." is still in the game!")
                else
                    --They are dead
                    for i,v in pairs(plrs) do
                    	if v == x then
                    		table.remove(plrs,i) -- Has to be a number for the index to use table.remove
                    	end
                    end
                    print(player.Name.." has been killed!")
                end
            end

This discussion is preserved as it was. New answers, comments, and votes are closed.