Ok so this is a script to open the gui, it works perfectly in studio but when in game it wont work
function die() script.Parent.Parent.Holder.Visible = true script.Parent.Visible = false end script.Parent.MouseButton1Down:connect(die)
Though what mosski123 posted should actually work, it does not give the ability to close the GUI. (I assume if you want to open it, at somepoint it would have to be closed?)
This script would go inside the button and local holder
should be linked to where ever holder is.
I don't quite know why in your example you have set the visibility of the button to false
but the holder set to true
, but if what I have done is not what you're after then it's easy enough to change!
If this answered your question, please click the 'Accept answer' box on the right -> If this does not work, please do tell me and if you'd like an explanation to how this works please do ask!
local holder = ----- script.Parent.MouseButtton1Click:connect(function() if holder.Visible == false then holder.Visible = true elseif holder.Visible == true then holder.Visible = false end end
local Holder = script.Parent.Parent.Holder script.Parent.MouseButton1Click:connect(function() Holder.Visible = true script.Parent.Visible = false end)
This should work, if it does, then please accept this answer.
local sp = script.Parent local holder = script.Parent.Parent:WaitForChild("Holder") function die() Holder.Visible = true sp.Visible = false end script.Parent.MouseButton1Down:connect(die)