Sword Sheath Not Working

Hello,

I want to make it so that when the player equips the tool, it disappears from their back. When they unequip it, it should return to their back. Here is my script.

local Tool = script.Parent

local Sword = game.StarterPlayer.StarterCharacter.sword

Tool.Equipped:Connect(function()

print("Equipped")

Sword.Transparency = 0

end)

Tool.Unequipped:Connect(function()

print("Unequipped")

Sword.Transparency = 1

end)

The output is fine but this script is not working. I don’t know why.

Thanks in advance,
cweego

Your problem is that the sword isn’t in starter player anymore but it’ll be either on the player’s character or in their backpack under their player instance. This is because the starter player is a folder full of items that replicate to the player once they join.

Try referencing the sword through script.Parent.Sword where the local script has the same parent as the sword.

Apart from that, your script should work fine.