TopbarPLUS button toggle

So, i’ve made a game similiar to “The Strongest Battlegrounds”, and i been trying to make a button from topbarplus like the one from the game itself, here’s some images describing it:

  • The game i’m working on
    image

  • Theirs
    image

As you can see, the strongest battlegrounds one doesn’t turn white when you click on it, and i’ve been really searching for a while a function like this one.

If anyone can help i will appreciate it.

1 Like
icon:bindEvent("selected", function()
    icon:deselect()
end)
2 Likes

Sorry for the late reply, it did quite work well, but when i added this function, i did so that, when the players deselects the button, they get teleported to another place.
But when i added icon.deselect() to a part of the script that makes the icon deselect for itself after some seconds (just like in tsbg), it teleports me to the place without clicking twice.

I’ve also discovered that there’s a function named userSelected and userDeselected which made the coding easier, so thanks for helping a bit.

1 Like

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