Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A tool with a skinned mesh attached to the player makes the player invisible when unequipped?

Asked by 3 years ago

So basically, I made an object with skinned meshes and attached it to the R6 player rig with Motor6D.

Everything works fine, but there’s an issue when the tool gets unequipped. It makes the character invisible until the tool is re-equipped.

How to resolve this? Thanks!

0
Please provide more information, like error codes and/or the script you wrote WoTrox 345 — 3y
0
There are no errors. The script itself just has an Unequipped() function where the Motor6D disconnects the skinned mesh from the torso. Soulettaa 0 — 3y
0
Can we see that? WoTrox 345 — 3y
0
I closed it for a bit, but here's the thing; there is an object which uses skinned meshes and a R6 rig. The object is inside of the tool. When the tool is equipped, the skinned object (part that has bones, etc.) is connected to the Torso of the R6 using Motor6D. When unequipped, the Motor6D unassigns both Part0 and Part1. It's all fine other than unequipping where the player goes invisible. Soulettaa 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Easy, you just get the players property and body parts, make an equip and unequip function, then set the players body parts to "1" which makes it invisible and if you want the player to make a ghost effect set the transparency to "0.5" if you want the tool to be transparent I recommend using a mesh part to set the transparency to 1 and your basically done, I could make you code if you'd like?

Code:

local Player = game.Players.LocalPlayer
local Character = Player.Character

script.Parent.Equipped:Connect(function(Mouse)
    Character:FindFirstChild("Left Leg").Transparency = 1
    Character:FindFirstChild("Right Leg").Transparency = 1
    Character:FindFirstChild("Torso").Transparency = 1
    Character:FindFirstChild("Left Arm").Transparency = 1
    Character:FindFirstChild("Right Arm").Transparency = 1
    Character:FindFirstChild("Head").Transparency = 1
    Character:FindFirstChild("Head").face.Transparency = 1
end)

script.Parent.Unequipped:Connect(function()
    Character:FindFirstChild("Left Leg").Transparency = 0
    Character:FindFirstChild("Right Leg").Transparency = 0
    Character:FindFirstChild("Torso").Transparency = 0
    Character:FindFirstChild("Left Arm").Transparency = 0
    Character:FindFirstChild("Right Arm").Transparency = 0
    Character:FindFirstChild("Head").Transparency = 0
    Character:FindFirstChild("Head").face.Transparency = 0
end)
Ad

Answer this question