Detect a specific Character Mesh

Hi! I want to make a script that clones Character Meshes to a character but if that character has a specific Torso Character Mesh, it will give different Character Meshes.


Explorer

Here’s my script (It only detects and clones to a character that has a specific Torso Character Mesh)

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		player.CharacterAppearanceLoaded:Wait()
		
		for i,v in pairs(char:GetChildren()) do
			if v:IsA("CharacterMesh") then
				if v.MeshId == 48112070 then v:Destroy() end
				
				for i,v in script.Female:GetChildren() do	
					v:Clone().Parent = char
				end
			end
		end
		
	end)
end)

Nvm I figured it out.

local Girl = false
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		player.CharacterAppearanceLoaded:Wait()
		for i,v in pairs(char:GetChildren()) do
			
			if v:IsA("CharacterMesh") then
				if v.MeshId == 48112070 then
					Girl = true
				end
				
				v:Destroy()
			end
		end
		
		if Girl == true then
			print("Girl")
			for i,v in script.Female:GetChildren() do
				v:Clone().Parent = char
			end
			
		else
			print("Boy")
			for i,v in script.Male:GetChildren() do
				v:Clone().Parent = char
			end
			
		end	
	end)

end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.