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

how do i make a player visible when they click a button?

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		for i,Child in pairs(Character:GetChildren()) do
			if Child:IsA('Part') then
				Child.Transparency = 1
			end
		end
		wait(2)
		for i,Child in pairs(Character:GetChildren()) do
			if Child:IsA('Accessory') then
				Child.Handle.Transparency = 1
			end
		end
		Character.Head.face.Transparency = 1
	end)
end)

so this code makes the player invisible when they join the game but how do i make it so that when the player clicks a button they are visible again

1 answer

✓ Accepted answer

You could simply use a click detector after putting it inside of a part.

local clickDetector = workspace.Part.ClickDetector
 
function onMouseClick(playerWhoClicked)
	print("You clicked me!")
end
 
clickDetector.MouseClick:connect(onMouseClick)

Then you copy and paste the code inside of that function and get the player's character from the variable 'playerWhoClicked.'

(make sure to make to accept the answer)

This discussion is preserved as it was. New answers, comments, and votes are closed.