I’m making a script where u can steal peoples body parts and use them as weapons. But when they go into your inventory, they get blocky because I have trouble copying the mesh from the character
The mesh itself is a CharacterMesh. What I’m trying to accomplish is copying the id from the charactermesh into a meshpart, then making that the tool instead. But I don’t know how to find the exact charactermesh to copy its id into the meshpart without making a ridiculously long script, since they all have the same names
game.Players.PlayerAdded:Connect(function(Player)
local occupied = Instance.new("BoolValue")
occupied.Name = "occupied"
occupied.Parent = Player
Player.CharacterAdded:Connect(function()
occupied.Value = false
local Character = Player.Character or Player.CharacterAdded:Wait()
local children = Character:GetChildren()
for i,v in pairs(children) do
if v:IsA("CharacterMesh") then
v.Name = v.BodyPart.Value
end
end
for i,v in pairs(children) do
local clone = script.ClickDetector:Clone()
clone.Parent = v
end
end)
end)
I tried getting the bodypart value of each charactermesh, and changing its name to that using for i,v in pairs, but it didnt work. It was my last solution so please help