love the module, thanks so much!
I might be missing it, but I’m searching for a way to close dropdown after an item inside has been clicked. Any ideas?
Probably due to early implimentation of this fork, @iamEvanRBLX literally released the fork 2 days ago (wonderful, but very early).
The fork’s version is on V2.9.2 {ALPHA} as of writing this, so it might still be hard to use, and may need configuration of the official topbarplus module from @ForeverHD and/or the Nanoblox team.
Would be in best interest to wait or change the code yourself (if you can)
The code he is mentioning is @Sqarv’s fork, which is different to mine.
I checked and I’m (pretty sure) this is not a issue on mine.
Also v2.9.2-alpha is not an official version, I released it because I think it will be useful to people + Nanoblox haven’t updated their repo for about a year now.
If people are interested with it, I might as well maintain it! What do you think?
-- // Services
local repStorage = game:GetService("ReplicatedStorage").storage
local plrs = game:GetService("Players")
-- // Requirements and Instances
local icon = require(repStorage.modules.Icon)
local iconctrl = require(repStorage.modules.Icon.IconController)
local thm = require(repStorage.modules.Icon.Themes)
local bdbl = Instance.new("BindableEvent")
-- // Variables
local plr = plrs.LocalPlayer
local plrscrp = plr.PlayerScripts
local plrgui = plr.PlayerGui
local chrct = plr.CharacterAdded:Added() or plr.Character
local hmd = chrct:WaitForChild("Humanoid")
-- // Buttons
local leaderboardbutton = icon.new()
leaderboardbutton:setImage("rbxassetid://14811714961")
leaderboardbutton:setOrder(1)
leaderboardbutton:bindEvent("selected", function()
print ("Leaderboard has now been selected")
end)
leaderboardbutton:bindEvent("deselected", function()
print ("Leaderboard has now been deselected")
end)
leaderboardbutton:bindToggleKey(Enum.KeyCode.Tab)
And i’m using the version i sent you the first message, so i think that’s the forked version.
That does not work. I think you meant plr.CharacterAdded:Wait().
Why are there so many unused variables?
You don’t need any of those.
When I changed those stuff, it worked.
My code:
-- // Services
local repStorage = game:GetService("ReplicatedStorage")
local plrs = game:GetService("Players")
-- // Requirements and Instances
local icon = require(repStorage.Icon)
-- // Variables
local plr = plrs.LocalPlayer
local plrscrp = plr.PlayerScripts
local plrgui = plr.PlayerGui
local chrct = plr.CharacterAdded:Wait() or plr.Character
local hmd = chrct:WaitForChild("Humanoid")
-- // Buttons
local leaderboardbutton = icon.new()
leaderboardbutton:setImage("rbxassetid://14811714961")
leaderboardbutton:setOrder(1)
leaderboardbutton:bindEvent("selected", function()
print ("Leaderboard has now been selected")
end)
leaderboardbutton:bindEvent("deselected", function()
print ("Leaderboard has now been deselected")
end)
leaderboardbutton:bindToggleKey(Enum.KeyCode.Tab)