I joined my brother's world because we were trading, and while I was there, my Arms Dealer NPC spawned into his world. How can I get him back into my world?
NPCs are not generated based on character, they're generated based on world. It's not "your" Arms Dealer, it's the Arms Dealer for your brother's world, no matter who caused the conditions to be fulfilled. You can spawn an Arms Dealer (and any other NPC) in as many worlds as you want, as long as the world has sufficient housing and all conditions for the NPC spawning are fulfilled.
Spawning NPCs into your world
Once the NPC conditions are met in a world, and there is a valid house for the NPC, the NPC will spawn in that world. To have the same NPC in another world, you need to ensure the conditions are met in that world, too.
Spawning the Arms Dealer
According to the Terraria Wikia,
The Arms Dealer may now spawn after defeating 50 Hellbats even if you do not have a gun in your inventory
Housing the Arms Dealer
Past that, you will want to ensure you have valid housing, for the Arms Dealer to move into. If all of this has been met, all you have to do is wait. Jump into your world, and play around for a bit, until you get the notification that "The Arms Dealer has arrived".
Still not working?
Here are some things to try, if it feels like you have waited for ages, and the Arms Dealer still hasn't shown up.
- Ensure a different NPC has not moved into the house. Go into the housing menu, and select "show flags". An NPC flag will appear inside each house, displaying the NPC that lives there. If your house does not display a flag, it is free.
- Ensure the house has met the basic housing requirements. Move inside, and select "test housing" from the housing menu. You will receive a confirmation message that the house is suitable to live in.
- Ensure your gun/bullet is in your immediate inventory. It won't count if they are in a chest, piggy bank, safe, or other storage device.
- Ensure the gun you are holding is on this list. According to the Terraria Wikia, magic guns do not qualify.
- Ensure the bullets you are holding are on this list. Not all items classified as ammunition count as being a bullet.
You should be able to spawn the Arms Dealer on your world, also. According to the wiki, the conditions require an empty house and at least one bullet-firing gun in your inventory (not in chests). Defeating 50 hellbats also allows the Arms Dealer to respawn, even without a gun in your inventory.