I’ve created a Module that makes teams a bit easier to handle, instead of having to do many lines of code to put tools and things in the player’s backpack when they join that team, this module does that for you,
Here’s how the module looks:
As you can see, you can set if the team change should remove the backpack the player already has, or you could also set it so players won’t get tools from the team they’re about to join.
I’m planning to make a V2 in the future, so please give some feedback on how this could be improved in the future, have fun!
Link to module:
List of features added in v1.1:
- Added ClearAllChildren to ClearPlayerBackpack instead of going through every children of the backpack.
- Added functionality for mass teaming via tables
- Separated AddTools and ClearPlayerBackpack to their own functions for less messy code
This module lacks functionality & is pretty poorly written.
:ClearAllChildren() exists, you don’t have to do a
:GetChildren() loop to clear every child.
- Could have at least separated the remove & add tools functionality. If you’re gonna add more to this module then doing the same thing you’re currently doing is gonna make it messy very quickly.
- Why do
Teams[Team] when you can literally just directly reference a Team and send it as a argument?
local Team = game.Teams.Team1
a,b do not contribute to the module’s readability. At least make it more readable by doing
- At least have a tools folder as an argument. Don’t make people put tools into places where they don’t belong without modifiying the module.
- As mentioned earlier, this module lacks some needed functionality & is pretty insignificant. Improve by adding more functions like mass-teaming/unteaming.
But he is not deleting everything, only tools
There would only be tools in the player’s backpack, so it doesn’t matter if I use in pairs or clearallchildren.
There could be local scripts and more
Why would there be any kind of script in backpack at all?
New scripters do that a lot. Like all the time because they follow bad or outdated tutorials
That’s their problem then. They’ll learn to not do it if they ever meet 1 to 1 with this issue.
Then it’s their fault that they followed an outdated tutorial and can’t use this module because of it.
Nothing is stopping them from learning how to use modules and later on write their own modules.
(post withdrawn by author, will be automatically deleted in 1 hour unless flagged)
Slow and useless? That’s pretty rude bruv
Any type of game can use this, not only “real good games”
Please at least show proof to back up your claim. Text is not enough.
What do you mean by “good” like a actually well made proper game or just a simple yet playable game?
A lot of games use teams, such as jailbreak.
Soo, jailbreak? [Thanks polarisprog.]
And many many tycoon games that are sometimes on the front page use teams for easier things, for example look at 2 player tycoons, they depend on teams for it to work properly.
Viruses do exist yes, but not in the good free models, free models with viruses aren’t on top of the toolbox, they’re way down and can easily be rid of viruses if you know how to do so.
Why would you use StringValue over a Team instance? You’re just making things unnecessary complicated.