1ForeverHD / TopbarPlus

Construct dynamic and intuitive topbar icons. Enhance the appearance and behaviour of these icons with features such as themes, dropdowns and menus.
https://devforum.roblox.com/t/topbarplus/1017485
Mozilla Public License 2.0
103 stars 134 forks source link

table got nil #84

Closed ICrashWindows12 closed 10 months ago

ICrashWindows12 commented 10 months ago

this line of code broke the entire script for some reason. It is located in the icon module script: for settingsType, settingsDetails in pairs(theme) do -- this line of code broke the entire script so guis maybe cannot show up because of it. Im not an expert at coding this but it also gives me this error: ReplicatedStorage.Icon:920: invalid argument #1 to 'pairs' (table expected, got nil)

I tested it with this script and modified it a bit. I also tested with my own Gui's but it doesn't work so it has to be something: -- This retrieves the theme module under Icon local iconModule = game:GetService("ReplicatedStorage").Icon local Icon = require(iconModule) local Themes = require(iconModule.Themes)

local Players = game:GetService("Players") local Player = Players.LocalPlayer local PlayerGui = Player.PlayerGui

local nanobloxFrame = PlayerGui:WaitForChild("nanobloxFrame")

-- Here we utilise the many other icon methods. You can view all of them at the docs. Icon.new() :setImage(6326373239) :setLabel("Nanoblox") :setCaption("lookondeeznutzlolgotem") :setTip("Open Nanoblox Panel (v)") :bindToggleKey(Enum.KeyCode.V) :bindToggleItem(nanobloxFrame) :setProperty("deselectWhenOtherIconSelected", false) :set("iconFont", Enum.Font.Arial) :setRight() :notify() :setTheme(Themes.YourThemeName) :bindEvent("selected", function(icon) print("selected!") end) :bindEvent("deselected", function(icon) print("deselected!") end) :setDropdown({ Icon.new() :setLabel("Item 1") , Icon.new() :setLabel("Item 2") , Icon.new() :setLabel("Item 3") , Icon.new() :setLabel("Item 4") , })

It will not give any error for this script but for the one in the icon modulescript.

ICrashWindows12 commented 10 months ago

I do not know how this code works basically works in the module script although I do know how to make it a topbar. I can't really provide more details but someone help me fix it

ICrashWindows12 commented 10 months ago

oh yeah i forgot to add theme name in the script