Which type of GUI should I use?

Hi, I’m making a restaurant game with NPCs and im trying to make a GUI that is above the NPC’s head that says “Take Order”. When you click it a random order will be created and so on.
Right now im trying to use a Billboard GUI but i’m having some issues when it comes to cloning them. I took a look at some other threads regarding buttons not working and they all say to parent the GUI to startergui. My only problem in this case is that startergui only updates on client when a player dies or rejoins. So, this is why I come to you, pro roblox devs, to ask; which is the best type of gui to use for this and if it is Billboard Gui’s how can I fix this issue? (Sorry for the long read im new to this)

1 Like

Um I would always use a Billboard as I find that they work fine for me when I use them. May I suggest if you are new watch a youtube vidoe on them.

1 Like

I’m not sure on whether or not using a different type of gui would be better as I think it comes down to preference. To fix your problem you could parent your Billboard Gui to StarterGui and create a function that destroys any clones of the Billboard Gui in PlayerGui and clones the BillboardGui in StarterGui to PlayerGui. Take this as an example:

--A LocalScript in StarterPlayerScripts
local billboardGui = game.StarterGui.BillboardGui -- A reference to your BillboardGui in StarterGui
local playerGui = game.Players.LocalPlayer.PlayerGui -- The player's PlayerGui

function respawnGui() -- clones the BillboardGui in StarterGui and parents the clone to PlayerGui, then destroys the old BillboardGui in PlayerGui
	local clone = billboardGui:Clone()
	clone.Parent = playerGui

You should be more focused on tackling this problem than trying to find a different Gui to use then. This is a pretty trivial problem that, with some work and the right questions, can be solved.

You don’t need to clone the BillboardGui necessarily, you can change its Adornee to the closest NPC that it should be tacked on to. BillboardGui supports ResetOnSpawn (it derives from LayerCollector), so you can turn that off if you don’t want it to go away when a player dies. Combine that with a LocalScript to manage the BillboardGui in PlayerScripts, a non-resetting container for client-side logic.

From there, it’s all down to making the BillboardGui adorn to the nearest valid NPC while also accounting for a respawned character.

Please don’t use the method from the post above. ResetOnSpawn was created for this case. cc @Kabutey