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

Need help with making a Gui show up and dissapear if the player clicked somewhere else?

I need this script to make the Gui disappear if the player clicked somewhere other than the certain area.

local Time = 4
script.Parent.MouseButton1Down:connect(function()
script.Parent.Selected.Visible = true
wait(4)
script.Parent.Selected.Visible = false
end)
script.Parent.MouseButton1Down:connect(function()
wait(0.5)
--[[I am stuck here. I need a way to tell if the Player clicked somewhere else other than script.Parent.Selected.Click (The name of the thing to click), and still let them click other things.]]--

1 comment

0

please paste entire script

1 answer

Im guessing that the gui you were talking about was on line 16 so what I did was I created a debounce so that you couldn't click it multiple times and it would make the gui visible, wait 4 seconds, then make it invisible

local Time = 4
script.Parent.MouseButton1Down:connect(function()
script.Parent.Selected.Visible = true
end)
script.Parent.MouseButton1Down:connect(function()
    while true do
    wait(1)
    if Time == 0  then
        script.Parent.Selected.Visible = false
    else
        wait(1)
    end
end
end)
local d = true
script.Parent.Selected.Click.MouseButton1Down:connect(function()
	if d==true then d=false
		script.Parent.Parent.Parent.Load.Assassin.Visible = true
		wait(4)
		script.Parent.Parent.Parent.Load.Assassin.Visible = false
		d=true
	end
end)

1 comment

0

Sorry, I got that part done (The Gui to show up was script.Parent.Selected), but I also need it to dissapear if the player clicked somewhere else than script.Parent.Selected.Click (Name of the button)

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