I went to StarterGui and added a ScreenGui and then a TextButton.. but idk the script for when you click the button, it turns the player invisible. Can someone please help?
COMMUNITY QUESTION
How do I make a button to make a player invisible?
1 answer
Put a Local Script inside the Text Button with the following code:
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
char = player.Character
char.Head.Transparency = 1
char.Torso.Transparency = 1
char["Left Arm"].Transparency = 1
char["Left Leg"].Transparency = 1
char["Right Arm"].Transparency = 1
char["Right Leg"].Transparency = 1
char.Head.face.Transparency = 1
for i,v in pairs(char:GetChildren()) do -- This is to go through things like hair, wings, etc.
if v.ClassName == "Accessory" then
v.Handle.Transparency = 1
end
end
end)
That code should work I think. If this helps, be sure to mark me as an answer. It would've been better if you'd shown us some coding in your question though.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You need a script from you for us to fix if you want us to do anything. We won't just do the scripting for you.
This is what I tried: local Button = script.Parent local Frame = Button.Parent.Frame Button.MouseButton1Down:Connect(function() Frame.Visible = false end) local Button = script.Parent.MouseButton1Click:Connect(function() local Player = script.Parent Button.LocalPlayer.Visible = false end)
Last post people were telling me I didnt need help because I put the scripts I tried in the post and they said since I knew about scripting I didnt need help :/