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

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

Asked by 10 years ago

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

0
Any output messages? You have hide and lhide set to the same object... OniiCh_n 410 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

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.

0
It's a text button... The game is here: http://www.roblox.com/Ro-Ships-2014-PRE-ALPHA-place?id=155448865 Michael007800 144 — 10y
0
Also tryed it in a normal script, not working... Michael007800 144 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

Hide and lhide are the same thing.

Answer this question