#Trying to give a team a custom model

1 messages · Page 1 of 1 (latest)

deft torrent
#

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

hazy coral
#

if thats a server script which i think it is you cant access player scripts from it

#

local FindCharacter = CustomCharacters:FindFirstChild(tostring(Player.Team))
do findfirstchild(player.team.Name)

deft torrent
hazy coral
#

if you make it a client script only that player will see the character

#

plus i dont thin copying all the scripts into a new charatcer will work

#

copy your character ing ame and back in studio paste it and edit it and you can do loadhumanoiddescription