what I mean is that this script is for my morph on a touch part and I was wondering how do I make it work on a gui like if someone press my button gui called Remove
Heres the script:
function onTouch(part) local human = part.Parent:findFirstChild("Humanoid") if human ~= nil then part.Parent:findFirstChild("Head").Transparency = 0 part.Parent:findFirstChild("Torso").Transparency = 1 part.Parent:findFirstChild("Left Arm").Transparency = 1 part.Parent:findFirstChild("Right Arm").Transparency = 1 part.Parent:findFirstChild("Left Leg").Transparency = 1 part.Parent:findFirstChild("Right Leg").Transparency = 1 end end script.Parent.Touched:connect(onTouch)
Make sure this is a LocalScript and inside the Button.
local Player = game.Players:WaitForChild(game.Players.LocalPlayer.Name) local Character = Player.Character local Button = script.Parent function HIDE() for _, v in pairs(Character:GetChildren()) do if v.Name ~= "Head" and v:IsA('BasePart') then -- makes all of the character's parts transparent except for the head v.Transparency = 1 end end end Button.MouseButton1Click:connect(HIDE)