I have a morth that gives me certain "skin", or character. The character has a head and a mask. I want the player to press M to remove the mask. Now, I dont want to destroy it, I want to make the player take it off and take it back on, so I am willing to make it transparent. But I dont know how, my script failed. I want the button M to take it off and if I press it again it will bring back the mask. How can I fix the script? Please help.
--// Variables:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
--// Take Off The Mask:
mouse.KeyDown:connect(function(key)
if key == "m" then
script.Parent:FindFirstChild("Mask")
if Mask.Transparency == 0 then
Mask.Transparency = 1
end
end
end)
--// Take On The Mask:
mouse.KeyDown:connect(function(key)
if key == "m" then
script.Parent:FindFirstChild("Mask")
if Mask.Transparency == 1 then
Mask.Transparency = 0
end
end
end)
(The "Mask" is something thats inside the player`s character after I get the skin.)

2 comments
KeyDown is deprecated
Still not working