Can you help me fix a bug with my TopbarPlus V2 script

hello Developers i Really Need your help, so in my upcoming game that is gonna release next week i just found a bug where if you reset/die in game the Topbar Plus icon i made does not open the menu,

do you know how to fix this?
and if so can you tell me how.

here is one of the models i made for this game so you can see what i mean.
https://www.roblox.com/library/9432519545/TopBarPlus-Halo-GUI

please help me fix this.

1 Like

The screen gui has reset on spawn enabled, I’m pretty sure disabling that will fix it.

1 Like

okay i will try that next time i work on my game, thank you so so much

TopbarPlus actually does that, it’s a glitch…
I believe doing something like this should work:

local Icon = require(game.ReplicatedStorage.Icon)

local function setGuiEnabled()
    local icon = Icon.new()
    -- Other icon configurations!
end

game.Players.PlayerAdded:Connect(setGuiEnabled)

Simple function that will only run when a player joins!

1 Like

i will try this when i get a chance to work on my game, thank you for being a helpful person.

1 Like

Disabling that will do nothing, the LocalScript that generates it doesn’t destroy it when you respawn, so it won’t destroy the old one, and will re-run the script to add a new UI.

it does not work :frowning: is there some other way to fix it, maybe i did it wrong can you show me pls

bro i have same problem right now:(

Hey, if you put the script inside another ScreenGui and set the ResetOnSpawn to false then it should work. I hope this helps!