GUI Untoggable with TopbarPlus

Hello, i’m ShyowwTheDev, you can call me Shyoww by short, i’m here posting this topic because of i having a issue, the issue is made caused by: TopbarPlus and a ScreenGUI.

  1. What do you want to achieve?
    A: Make the ScreenGUI appear whenever i reset, since it doesn’t (for now) appear when i reset.

  2. What is the issue?
    A: Everything works fine with the ScreenGUI, but, the issue is that, whenever i reset my character in studio and i try select the button (TopbarPlus to be more specific), the GUI just doesn’t show up. And for some reason, the GUI needs to be with ResetOnSpawn on or else the entire thing just breaks, and as you may know, TopbarPlus requires a ScreenGUI with ResetOnSpawn off.

  3. What solutions have you thought of so far?
    A: None, since it’s quite impossible for me to get a solution on how to make the GUI work again.

My TopbarPlus script if needed:

-- // Emotes Button
local emotebutton = icon.new()
    emotebutton:setImage("rbxassetid://9006890331")
    emotebutton:setOrder(3)
    emotebutton:bindEvent("selected", function()
	    emoteopen:Play()
	    print ("Emote has been selected")
end)
    emotebutton:bindEvent("deselected", function()
	    emoteclose:Play()
	    print ("Emote has been deselected")
end)
    emotebutton:bindToggleKey(Enum.KeyCode.G)
    emotebutton:bindToggleItem(emotegui)

You may want to turn your attention to the TopbarPlus API, specifically with “clearIconOnSpawn”.

At the very bottom of your Topbar script, you should have lines of code that look identical to the example listed above. I would uncomment it since it pertains specifically to GUIs with ResetOnSpawn enabled.

I will see if this works tomorrow, i’ll keep ya tuned!

it literally deleted every single icon i had when i respawned.

If I’m reading your issue correctly, you want the ScreenGUI to not reset on spawn since it causes the buttons to break. If you got rid of the clearIconOnSpawn code and are still having issues. Be sure:

  1. The ScreenGUI’s ResetOnSpawn is set to false
  2. The path to your emotegui is valid.

This is my version at the bottom of the script:

--Assuming emoteopen and emoteclose are sounds
local emoteopen = Instance.new("Sound")
emoteopen.SoundId = "rbxassetid://157167203"
local emoteclose = Instance.new("Sound")
emoteclose.SoundId = "rbxassetid://6106457841"

local emotegui = script.Parent:WaitForChild("Emote") --made reference to an "Emote" frame inside the ScreenGui

local emotebutton = Icon.new()
emotebutton:setImage("rbxassetid://9006890331")
emotebutton:setOrder(3)

emotebutton:bindEvent("selected", function()
	emoteopen:Play()
	print ("Emote has been selected")
end)

emotebutton:bindEvent("deselected", function()
	emoteclose:Play()
	print ("Emote has been deselected")
end)

emotebutton:bindToggleKey(Enum.KeyCode.G)
emotebutton:bindToggleItem(emotegui)

--[[local icons = IconController.getIcons()
for _, icon in pairs(icons) do
	IconController.clearIconOnSpawn(icon)
end]]

Let me explain better:

When the ScreenGUI is with ResetOnSpawn on, the buttons work but the GUI doesn’t show up, and, if ResetOnSpawn is off, the buttons don’t work and the GUI does show up,
I’ll actually see if it now works.

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