Custom Character Help

If it’s a direct child of ServerStorage (not in a folder, for example), then try what @sonicfoo3 posted in his latest reply. But change modelname to the name of your character. If I’m correct, WaitForChild isn’t necessary in server scripts for referencing objects created in studio.

Alright, I tried it and this is what happened weirdthing

Maybe add some Instance called “IsCustom” to your custom character and then use this.

local Players = game:GetService("Players")

local ID = -- the userid id of your friend
local customChar = -- the character

Players.PlayerAdded:Connect(function(plr)
    if plr.UserId == ID then
        plr.CharacterAdded:Connect(function(char)
            if not char:FindFirstChild("IsCustom") then
                local newChar = customChar:Clone()
                newChar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
                plr.Character = newChar
                newChar.Parent = workspace
            end
        end)
    end
end
2 Likes

If I’m correct in saying, should the newchar.Parent = workspace be newchar.Parent = plr?

What is an instance? I am so very sorry, I am quite new.

1 Like

An instance, is how you create something from within a script. For example, if I wanted to create a part in a script, I would say
local part = Instance.new("Part")

2 Likes

An instance is an object that can be seen in the explorer, for example, part or model

2 Likes

So would I add a part named IsCustom to my custom character?

1 Like

If you look at the explorer in play mode in studio you’ll notice that characters are parented to workspace. Player.Character is a property of player and it’s a Reference to the character.

1 Like

It doesn’t need to be a part. Folders, value objects and many other things are Instances too. You could add a folder and name it “IsCustom”.

1 Like

I tried and it didn’t change anything. It still duplicates the character.

1 Like

Did you include the quotation marks when naming the folder. If you did, remove them, but keep them in the script.

1 Like

IT still doesn’t work.


1 Like

Could you show a picture of the explorer, where I can see the character and its children.

1 Like

In play mode?
30 characters


You can also take it in editmode, I want to see the character in ServerStorage

2 Likes

image

1 Like

so, do you know a solution?


Unfortunately, I don’t. I’ll try to find what problem there is in the code I gave you when I’m on computer again.

local Players = game:GetService("Players")

local ID = -- the userid id of your friend
local customChar = game.ServerStorage.customchar

Players.PlayerAdded:Connect(function(plr)
    if plr.UserId == ID then
        plr.CharacterAdded:Connect(function(char)
            if char.name ~= "customchar" then
                char:Destroy()
                local newChar = customChar:Clone()
                newChar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
                plr.Character = newChar
                newChar.Parent = workspace
            end
        end)
    end
end)