Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make my GUI script hide when clicked and come back when someone dies or resets?

Asked by 9 years ago
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

Log in to vote
0
Answered by 9 years ago

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.

0
Said GUI was an invalid piece of code and it didn't work it didn't diseapper when clicked XxLuascriptshandsXx -3 — 9y
0
It's just an Example.. Just change it around. Roblox_v10 33 — 9y
Ad

Answer this question