Alright, so I’ve tried to do this for awhile for a feature.
I am trying to make a feature that when you click a button it inserts a character mesh into that player. The reason I am trying to make sure a feature is so I can have male and female characters, so the character mesh would be a female torso mesh, however I’m not sure how to go about doing this.
I’m not sure how to go about this, as I am not a scripter.
I have tried a script that gives players tools, however a mesh obviously isn’t a tool so that didn’t work and that’s when I’m not sure.
So the big question is how do I make a text button thats inserts a character mesh into a player who clicked the button.
You need to learn about and create new CharacterMeshes (Assuming you are working with R6)
In here is a female rig built with studio, you need to create 5 character meshes with correct IDs, each corresponding to a limb excluding the head. Instance.new("CharacterMesh")
Or you can store them in ServerStorage or ReplicatedStorage and just put them in the character.
(Remember to remove all existing CharacterMeshes.)
Creating Meshes for Female:
function CreateMesh(Limb, ID, Char)
local LL = Instance.new("CharacterMesh")
LL.BodyPart = Limb
LL.MeshId = ID
LL.Parent = Char
end
-- Female:
local Char = Player.Character -- You have to put in character yourself
-- First you have to remove all CharacterMeshes
for _,v in pairs(Char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destory()
end
end
CreateMesh("LeftLeg", 81628361, Char)
CreateMesh("RightLeg", 81628308, Char)
CreateMesh("LeftArm", 83001137, Char)
CreateMesh("RightArm", 83001181, Char)
CreateMesh("Torso", 82987757, Char)
Or you could
MeshesFolder = game.ReplicatedStorage.Meshes or game.ServerStorage.Meshes
function Female(Char)
-- First you have to remove all CharacterMeshes
for _,v in pairs(Char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destory()
end
end
MeshesFolder.Female.LeftLeg:Clone().Parent = Char
MeshesFolder.Female.RightLeg:Clone().Parent = Char
MeshesFolder.Female.LeftArm:Clone().Parent = Char
MeshesFolder.Female.RightArm:Clone().Parent = Char
MeshesFolder.Female.Torso:Clone().Parent = Char
end
function Male(Char)
-- First you have to remove all CharacterMeshes
for _,v in pairs(Char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destory()
end
end
MeshesFolder.Male.LeftLeg:Clone().Parent = Char
MeshesFolder.Male.RightLeg:Clone().Parent = Char
MeshesFolder.Male.LeftArm:Clone().Parent = Char
MeshesFolder.Male.RightArm:Clone().Parent = Char
MeshesFolder.Male.Torso:Clone().Parent = Char
end
-- Then Later:
local Char = Player.Character -- You have to put in character yourself
if Male then
Male(Char)
elseif Female then
Female(Char)
end