You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
I have a viewmodel, and I want to make the viewmodel have the same meshid as the player’s body parts. This is an R6 game so i’m using the charactermesh object.
- What is the issue?
I remember somehow I was making it work in the beginning, the meshid would be replicated on the player’s body arms. However, now it isn’t. Instead when you set the meshid the player’s arms go invisible. Not sure why.
local Player = game.Players.LocalPlayer
local Character = script.Parent
local Cam = workspace.CurrentCamera
local ViewModel = game.ReplicatedStorage:WaitForChild("ViewModel"):Clone()
for Every, Descendant in Character:GetDescendants() do
if Descendant:IsA("BodyColors") then
local BC = Descendant:Clone()
BC.Parent = ViewModel
-- Body colours working
end
if Descendant:IsA("CharacterMesh") then
if string.match(Descendant.Name, "Right Arm") then
-- Mesh ids make the arms go invisible
local CM = Descendant
ViewModel:WaitForChild("Character Right Arm").OverlayTextureId = CM.OverlayTextureId
ViewModel:WaitForChild("Character Right Arm").MeshId = CM.MeshId
end
if string.match(Descendant.Name, "Left Arm") then
local CM = Descendant
ViewModel:WaitForChild("Character Left Arm").OverlayTextureId = CM.OverlayTextureId
ViewModel:WaitForChild("Character Left Arm").MeshId = CM.MeshId
end
end
end
ViewModel.Parent = Cam
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
if Character:WaitForChild("Humanoid").Health == 0 then
if Cam:WaitForChild("ViewModel") then
Cam:WaitForChild("ViewModel"):Destroy()
end
end
if Cam:WaitForChild("ViewModel") then
Cam:WaitForChild("ViewModel"):WaitForChild("HumanoidRootPart").CFrame = Cam.CFrame * CFrame.new(.025, -1.5, -1)
end
end)
Any help is really appreciated.