Detecting when a player is near another player in a specific team

Hello. I’m trying to make a pick pocket system that detects if player1 is near player2 (player2 must be in a specific team, if you get what i mean).

Any ideas on how i could accomplish this? Thank you.

one idea is to make an instance.new and then set the can collide to false and the transparency to 1
it must also be welded with the player if the player is from a team name that part the name of the team andasi and the mature cat comes to your house

It depends on the route you’re trying to go with this. Have you considered ProximityPrompts? A possible idea is when a player joins to add a ProximtyPrompt to their character. Whenever teams are chosen, you fire a remote to the client which would loop through each players character for a proximity prompt. If the player is on the same team as the client, you could disable the ProximtyPrompt on the players character, if the team is different you can enable the ProximtyPrompt.

If you do go this route, make sure you check whenever the ProximityPrompt is activated if the player is able to pickpocket the player, otherwise without any serversided sanity checks it might be a little chaotic and venerable to exploits.

If you’d like any pseudocode let me know.

1 Like