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 my GUI script hide when clicked and come back when someone dies or resets?

print("Close button loaded")

button = script.Parent
window = script.Parent.Parent.Parent

function onClicked(GUI)
	window:remove()
end
script.Parent.MouseButton1Click:connect(onClicked)
print("Gender Selection")
torso = script.Parent.Parent.Parent.Parent.Character.Torso

function onClicked(GUI)
		torso.CFrame = CFrame.new(Vector3.new(-3.89, 1.09, -22.006)) -- CHANGE THE NUMBERS TO WHERE YOU WANT TO TELEPORT TO!
end 

script.Parent.MouseButton1Click:connect(onClicked) 

Reminder: This Script is a Close on click and teleportation script

This may help http://gyazo.com/48702c7a2f4b9f7018bea7fb35da637a

1 answer

✓ Accepted answer

I am not 'gonna change anything around, because I don't 'wanna mess it up. So something similar to this.

game.Players.ChildAdded:connect(function()
	GUI = game.StarterGUI.ScreenGui
	
	if script.Parent.Parent.Character.Humanoid.Health == 0 then
		GUI.Visible = true
	end
end)

That's the best I can tell you for now.

2 comments

0

Said GUI was an invalid piece of code and it didn't work it didn't diseapper when clicked

0

It's just an Example.. Just change it around.

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