I’m having difficulty understanding why this script only works sometimes, and other times it doesn’t. It’s supposed to change the player’s team as well as their clothes but it doesn’t work.
It’s a normal script in ServerScriptService.
local ScientistClass = game.ReplicatedStorage.ScientistClass
local Teams = game:GetService("Teams")
local players = game.Players
ScientistClass.Event:Connect(function(player)
print('working')
player.CharacterAdded:Connect(function (character)
character:WaitForChild("Shirt"):Destroy()
character:WaitForChild("Pants"):Destroy()
local Shirts = Instance.new("Shirt",character)
local Pants = Instance.new("Pants", character)
player.Team = Teams.Scientist
Shirts.ShirtTemplate = "http://www.roblox.com/asset/?id=519722780"
Pants.PantsTemplate = "http://www.roblox.com/asset/?id=519722963"
player.Character.HumanoidRootPart.CFrame = CFrame.new(25.57, 15.547, 46.05)
end)
end)