I followed a tut on youtube for this, but its not working. Im trying to give the Players in a team a Custom model. Output isnt giving me any ideas on whats wrong either,
this is the script im using
game.Players.CharacterAutoLoads = false
local CustomCharacters = game.ServerStorage:WaitForChild("CustomCharacters")
local StarterCharacterScripts = game.StarterPlayer:GetChildren()
local RespawnTime = 3
local NeutralConnections = { }
local Angels = game.Teams.AngelsTrumpet
local AngelsSpawn = workspace:WaitForChild("AngelsTrumpetSpawn").CFrame + Vector3.new(0, 5, 0)
local function OnSpawn(Player)
if not game.Players:FindFirstChild(tostring(Player)) then return end
local FindCharacter = CustomCharacters:FindFirstChild(tostring(Player.Team))
if FindCharacter then
local NewCharacter = FindCharacter:Clone()
NewCharacter.Name = Player.Name
for i, item in pairs(StarterCharacterScripts) do
item:Clone().Parent = NewCharacter
end
if Player.Team == Angels then
NewCharacter.HumanoidRootPart = AngelsSpawn
end
Player.Character = NewCharacter
NewCharacter.Parent = workspace
else
Player:LoadCharacter()
if Player.Neutral then
Player:GetPropertyChangedSignal("Team"):Connect(function ()
NeutralConnections(Player):Disconnect()
OnSpawn(Player)
end)
end
end
end
local function FirstAdd(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
wait(RespawnTime)
OnSpawn(Player)
end)
end)
OnSpawn(Player)
end
game.Players.PlayerAdded:Connect(FirstAdd)
for i, team in pairs(game.Teams:GetTeams()) do
team.PlayerRemoved:Connect(OnSpawn)
end