Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local teams = game:GetService("Teams")
- local Team1 = game.Teams.Police
- local Tools1 = game.ReplicatedStorage.PoliceTools
- local Team2 = game.Teams.Criminal
- local Tools2 = game.ReplicatedStorage.CriminalTools
- local function AddTools(backpack, tools, startergear)
- for _, tool in pairs(tools:GetChildren()) do
- tool:Clone().Parent = backpack
- tool:Clone().Parent = startergear
- end
- end
- local function ChangeTeam(player)
- local backpack = player.Backpack
- local startergear = player.StarterGear
- backpack:ClearAllChildren()
- startergear:ClearAllChildren()
- if player.Team == Team1 then
- AddTools(backpack, Tools1, startergear)
- elseif player.Team == Team2 then
- AddTools(backpack, Tools2, startergear)
- end
- end
- Team1.PlayerAdded:Connect(ChangeTeam)
- Team2.PlayerAdded:Connect(ChangeTeam)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement