Accessory Positioning Problem

After a couple of hours, I finally accomplished my task, only to know I’ve been met with another problem again… So good news and bad news. Good news is I finally finished the difficult part of my project and the bad news is that I’ve discovered another problem (Or ‘part’ in particular). I have a couple of photos I have taken to get a better understanding of what’s going on:

The NPC is on the left and me on the right. So what’s going on here? If you look at the right, it’s just my current avatar, but on the left, you’ve been met with an abomination. Or in more detail, all of the hats and accessories were placed specifically in the Head’s position. Also, I think this doesn’t matter, but here’s the script:

game.Players.PlayerAdded:Connect(function(player)
local humanoidnpc = script.Parent.Humanoid
humanoidnpc:ApplyDescription(game.Workspace:WaitForChild("Script"))
end)

Also, I mean a LocalPlayer NPC when you see your character on an NPC but the others see their character.

And yes, there are multiple scripts leading to this but I believe that this script is the most important one. Questions? Answers? Forgot something? Comment below! :wink:

I haven’t really created NPCs before, so I’m not familiar right now with how the hats and stuff are imported.

However, if you want, you can manually set the positions of the accessories.

myhat.CFrame = thehead.CFrame * CFrame.new(0, 1, 0)
--this line will position the hat one stud above the head
--note that you may also need to use a ManualWeld or some constraint
   --along with setting the CFrame
1 Like

I’d use the manual option, but there’s a problem. You see, when I mean’t Local Player NPC, I mean’t when the player joins, they can only see their body on the NPC while the other player can see his/her body on the NPC. That’s why it’s called Local Player NPC. Sorry if you already knew that, but even if I’ve done that, there are like a million hats on the Roblox page.

Oh. Maybe just clone each player’s character locally? I’m not the best person to ask about hats and custom NPCs, I haven’t really imported any characters.

1 Like

why not just clone the character?
or you can also use GetCharacterAppearanceAsync

1 Like

So, I didn’t put this in, (my bad), but you know the cutscenes from the game “Piggy”? You can only see your characters while the other people see their characters too.

ye, i know that.(30 charsssssssss)

1 Like

Well first, I don’t know how to clone the character with the animations or make the other people invisible on your client screen.

then its not an accessory problem but more into cloning character locally problem right?

I didn’t clone the character…?

then just use : Players | Documentation - Roblox Creator Hub
it will make a humanoid with all the accesories of the character and parent it to workspace!
or
just set the archivable of the player character to true, then on the client clone it, parent it to workspace, and then load all the animations into the cloned character humanoid(on the client).

I like your idea, but I’m just going to go simple here. Do you know how to make it where you can only see your character and make the other people transparent? (Locally)

yes, run the script in a LocalScript.

I don’t think you understand what I mean. So a LocalScript makes the player not see the other players. That effect applies to other people too.

then it will be:

for i,v in pairs(game.Players:GetChildren()) do
local char = v.Character
if char then
char.Parent = game.ReplicatedStorage
end
end

there, it should make all the other players invisible.
(put it in a localscript)

1 Like

How’d this work? It just made my character not load.

oh yeah! i forgot, it should be:

for i,v in pairs(game.Players:GetChildren()) do
local char = v.Character
if char and char ~= game.Players.LocalPlayer.Character then
char.Parent = game.ReplicatedStorage
end
end
1 Like

So something weird happened… I ran 2 players on studio, the first player can’t see the other player (Which is good), but Player 2 can still see Player 1.

oh then it will be :

for i,v in pairs(game.Players:GetChildren()) do
local char = v.Character
if char and char ~= game.Players.LocalPlayer.Character then
char.Parent = game.ReplicatedStorage
end
end
workspace.ChildAdded:Connect(function()
for i,v in pairs(game.Players:GetChildren()) do
local char = v.Character
if char and char ~= game.Players.LocalPlayer.Character then
char.Parent = game.ReplicatedStorage
end
end
end)
1 Like

Why are you putting player objects in replicated storage? Just check in the loop of the character if its a part or “BasePart”/Accessory and set its transparency to 1?

1 Like