#Character selection that ACTUALLY changes model

1 messages · Page 1 of 1 (latest)

dull sinew
#

Hello, what would i do to change the character's model using input

I know naming a model "StarterCharacter" makes ur model, but I want to interchange them for the future.

Not asking for script, just need to know concept.

limpid bridge
#

I guess

#

Ur model has to be rigged with a humanoid

undone pier
#

the way I did character creation at one point

#
local Character = CharacterMaker.LoadPlayerCharacter(Player,Slot)
    
    Character.Name = Player.Name
    
    Player.Character = Character
    Character.Parent = workspace
    
    Character.PrimaryPart:SetNetworkOwner(Player)
    
    for i,v in game.StarterPlayer.StarterCharacterScripts:GetChildren() do
        
        local dup = v:Clone()
        dup.Parent = Player.Character
        
    end
    
    Player.Character.Humanoid.WalkSpeed = 16

-- how I set the character after creating it with my creator function LoadPlayerCharacter(), do note Players.CharacterAutoLoads == false)
#
-- creator function

function CharInfo.LoadPlayerCharacter(Player,Slot)
    
    local Data = DataManager.GetData(Player,'Profiles')
    
    
    if Data and Data[Slot] then
        
        local Slot = Data[Slot]
        local CharacterData = Slot.Character
        
        local Race = CharacterData.Race.RaceType
        local RaceInfo = Races.Info[Race]
        local RaceCosmetic = RaceInfo.Cosmetic
        
        local SkinColor = Color3.new(CharacterData.SkinColor[1],CharacterData.SkinColor[2],CharacterData.SkinColor[3])
        local Height = CharacterData.Height
        
        local Shirt = `rbxassetid://{Outfits.Spawn[CharacterData.Outfit.Name].Shirt}`
        local Pants = `rbxassetid://{Outfits.Spawn[CharacterData.Outfit.Name].Pants}`
        
        local StarterCharacter = Races.Starter:Clone()
        
        if RaceCosmetic ~= {} then -- add race cosmetic if they have 
            
            for i,v in RaceCosmetic do
                
                local Clone = v.Model:Clone()
                local Connect = Instance.new('Motor6D')
                
                Clone.Parent = StarterCharacter[`{v.Parent}`]
                Connect.Parent = StarterCharacter[`{v.Parent}`]
                Connect.Part0 = StarterCharacter[`{v.Parent}`]
                
                Connect.Part1 = Clone
                Connect.C0 = CFrame.new(table.unpack(v.Frame))
                
                
                
            end
            
        end
        
        for i,v in StarterCharacter:GetDescendants() do -- racecolor
            
            if v:IsA('Part') or v:IsA('BasePart') or v:IsA('MeshPart') then
                
                v.Color = SkinColor
                
            end
            
        end

        StarterCharacter.Pants.PantsTemplate = Pants
        StarterCharacter.Shirt.ShirtTemplate = Shirt
        
        StarterCharacter:ScaleTo(Height)
        
        return StarterCharacter
        
    end
    
end