Team Ban Script

How do I ban people from teams using a script?

Example: If a person continues to abuse on a team called security, they get banned from that team only.

I want this to be global and permanent but I haven’t figured out a solution.

Add an attribute to the player, like bannedFromSecurity and when he joins taht team simply check if it’s true or false, if true kick him, if not then allow him to joinn

1 Like

I don’t want to kick him, I just don’t want them to be able to join the team again.

I meant kick them from the team

Don’t attributes get removed when they rejoin?

You would probably use datastores to store determine whether or not they are banned from the team.

Oh, sorry, I forgot about that, yes, use DataStores, it’s better

The solution really depends on the script that sets and manages player teams. Basically, you have to set up a way for that script to recognize a player who doesn’t have access to a team and then set their chance of being assigned to that team to 0. If the teams in your game are assigned automatically and players don’t need the server to assign them to one just check if every time they get assigned to a team(through an event) if that team is a team they have access to or no, and if no then just manually change their team to something else random or handle it however you like.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.