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

This gives an error for no apparant reason?

Pretty much my whole gui is working but i decided to add tabs so i made it like this

Topbar > Mainframe > tabbutton1 Topbar > Mainframe > tabbutton2 Topbar > Mainframe > tabbutton3

Topbar > Tab1 Topbar > Tab2 Topbar > Tab3

And now when i added the script that is meant to make Tab 1 and 2 visible = false i get an error saying this

Attempt to index global "tab2" (a Nil Value)

Heres the script that does it

tabbutton1.MouseButton1Click:connect(function()
tab1.Visible = false
tab2.Visible = false
tab3.Visible = True
end)

Any help on this please

Thats my layout in a picture

4 comments

0

Try adding WaitForChild()

0

Post the whole script. With these 5 lines we cant help you. also, you have True capitalized.

3

All errors are shown for a reason, http://wiki.roblox.com/index.php?title=Lua_errors

0

^

1 answer

it's true not True

5 comments

0

eryn plz XD

1

Pfft, you'd think the owner of the site would know when to make a comment and when to make an answer

0

@Perci1 this is an answer, though. Why would she post it in the comments.

0

because it's not a full answer, just a quick little fix that doesn't solve the original error asked about.

1

its not even the ful answer, as he hasnt defined tab1,2,3

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