I made a script that turns the player completely transparent, the only problem is I can't make the players hats transparent. How would I make every hat in the player transparent?
Code (Local script):
local plr = game.Players.LocalPlayer
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.Z then
plr.Character.Head.Transparency = 1
plr.Character.Torso.Transparency = 1
plr.Character["Right Arm"].Transparency = 1
plr.Character["Left Arm"].Transparency = 1
plr.Character["Right Leg"].Transparency = 1
plr.Character["Left Leg"].Transparency = 1
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

3 comments
It makes the body transparent but it doesn't delete the hats, so I changed Destroy to Remove and that didn't work either. I also checked if my game as on FE and its not.
Alright, I'll edit my answer to make it change the hat to transparent instead of destroy.
Thanks! Works like a charm!