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

This should work but it's not! What is left out?

I am making a Ship Simulator (Last time a popular one appeared was late 2010!) but I am having troubles in the menu of the game! I think I might have left something small but crucial out as I have checked the locations of the GUI's and all is current.

local Button = script.Parent
Frame = script.Parent.window2
hide = script.Parent.open
lhide = script.Parent.open2

function onClick()
if lhide.Visible == false then
lhide.Visible = true
elseif lhide.Visible == true then
lhide.Visible = false
end
if Frame.Visible == false then
Frame.Visible = true
elseif Frame.Visible == true then
Frame.Visible = false
end
if hide.Visible == false then
hide.Visible = true
elseif hide.Visible == true then
hide.Visible = false
end
end

Button.MouseButton1Click:connect(onClick)

Hope you can help,

Michael

1 comment

0

Any output messages? You have hide and lhide set to the same object...

2 answers

I can't see any problems. If you're sure all the pathways are correct, then the only thing I can think of on hand is that Button is not a TextButton or ImageButton.

If Button is just a regular gui instance (such as a TextLabel) then this will not work, it has to be a TextButton or ImageButton.

2 comments

0

It's a text button... The game is here: www.roblox.com/Ro-Ships-2014-PRE-ALPHA-place?id=155448865

0

Also tryed it in a normal script, not working...

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