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

Scrip Working in Studio and not in game?

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)

3 comments

0

"Holder?"

0

thats the name of the frame

0

is the script a localscript?

3 answers

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.

2 comments

0

local script or regular?

0

Whichever one you used

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)

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