TopBarPlus multiple buttons bug

So I have recently started using TopbarPlus v2.9.1 but I received some bug when I tried to make two buttons.


The reset button works perfectly fine but Its also works on other buttons after I died(It happens only one time)

The code I use:

local iconModule = game:GetService("ReplicatedStorage").Icon
local Icon = require(iconModule)
local invite = Icon.new()
	:setLabel("test")
local reset = Icon.new()
	:setLabel("reset")
function death(chr)
	game:GetService("ReplicatedStorage").Reset:Fire()
end
reset.selected:Connect(function()
	death()
end)
reset.deselected:Connect(function()
	death()
end)

Any answer will be helpful

3 Likes

You are detecting if the reset button is being deselected too, which means if you click another button it fires the death too. Simply remove the reset.deselected connection and it should be fixed.

it works but i need to click the button 2 times to make the button work because now the deselected func is removed. Is there any chances to fix that?

Try using reset.toggled maybe? (replaces reset.selected)

I just found another way to fix it,
Here : deselectWhenOtherIconSelected.
The default is true so I just need to change it to false

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.