How can I import scripts specific scripts into a player that has changed teams?

Hello, I am making a game sort of like “Flee the Facility”. And right now I’m wondering when the server picks who the killer would be; How would I be able to let that player use/give the necessary components in order to play with that killer? For example, my idea was to change the character model, detect specific inputs/scripts, etc. How would I “import” those necessities so when the player play’s as the killer, it could actually work?

For now I just tested if I parent a clone of a script from serverStorage, into the player. The script sometimes work but I’m wondering if there would be a better way of tackling this situation.

Any help is appreciated! :grinning:

Most games that have randomly chosen roles start off by putting all the players in the game into one table. Then, math.random() is used to choose a random index from inside this table. Let’s pretend for a moment that there are five people playing your game right now. At the time when one of them joined, the new person would be put into this table, (which now looks like this, just for you to visualise what’s going on here) {“John”,“Sarah”,“Bob”,“Allan”,“Emily”}. The random index is chosen local selected = math.random(1,#gamePlayers), then gamePlayers[selected] . And that is who will be the person with the special role.

As for giving the special character their own perks/character skin/tool, I would use events, and checking if the special player is there, etc.

1 Like

Could I just give/assign the needed values, scripts, etc. For the killer or is it more complicated than that? (Just adding the scripts into their playerScript or Character basically.)