Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a button to make a player invisible?

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?

3 comments

0

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.

0

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)

0

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 :/

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.