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

This gives an error for no apparant reason?

Asked by 7 years ago

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

0
Try adding WaitForChild() dovydas12345 15 — 7y
0
Post the whole script. With these 5 lines we cant help you. also, you have True capitalized. RubenKan 3615 — 7y
3
All errors are shown for a reason, http://wiki.roblox.com/index.php?title=Lua_errors User#5423 17 — 7y
0
^ RubenKan 3615 — 7y

1 answer

Log in to vote
4
Answered by
evaera 8028 Trusted Badge of Merit Snack Break Game Jam Winner Moderation Voter Administrator Community Moderator Super Administrator
7 years ago

it's true not True

0
eryn plz XD RubenKan 3615 — 7y
1
Pfft, you'd think the owner of the site would know when to make a comment and when to make an answer Perci1 4988 — 7y
0
@Perci1 this is an answer, though. Why would she post it in the comments. OldPalHappy 1477 — 7y
0
because it's not a full answer, just a quick little fix that doesn't solve the original error asked about. Perci1 4988 — 7y
1
its not even the ful answer, as he hasnt defined tab1,2,3 RubenKan 3615 — 7y
Ad

Answer this question