Hi, I am currently working on a cafe game and I want that only the Barista-Team has a job outfit. How do I make the Costumer-Team have their own clothing? This is what my script looks like now:
local ss = game:GetService("ServerStorage")
game.Players.PlayerAdded:Connect (function (player)
player.CharacterAdded:Connect (function (character)
if player.Team == game.Teams.Barista then
local shirt = character:WaitForChild("Shirt")
local pants = character:WaitForChild("Pants")
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=000000"
pants.PantsTemplate = "http://www.roblox.com/asset/?id=00000"
local hat = nil
hat = ss:WaitForChild("hat"):Clone()
local hum = character:WaitForChild("Humanoid")
hum:AddAccessory(hat)
end
end)
end)

2 comments
I tried it and it worked! But if the player switches team it won't change the outfit
use team.playeradded or getpropertychangedsignal i think also works [for both just run same code again] or just respawn character