#how to make only team gear
7 messages · Page 1 of 1 (latest)
Do you want to unable other team to not get or not use it
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(Char)
local Folder = script:FindFirstChild(p.Team.Name)
if Folder then
--If class has spawn tools
local Tools = Folder:FindFirstChild("Tools")
if Tools then
--Goes through tools
for i,v in pairs(Tools:GetChildren()) do
--Makes a copy of the tool and puts it in user's inventory
v:Clone().Parent = p.Backpack
end
end
--Last of tools
--Checks if class has clothes
local Clothes = Folder:FindFirstChild("Clothes")
if Clothes then
--Goes through clothes
for i,v in pairs(Clothes:GetChildren()) do
local Clothing = Char:FindFirstChild(v.Name)
if Clothing then
Clothing:Destroy()
end
v:Clone().Parent = Char
end
end
end
end)
end)
put script in serverscriptservice
put the files like this under the script i sent above
rename the files saying inmates and police to the team names you have