script.Parent.DialogChoiceSelected:connect(function(player,dialog) local gui = script.Parent.Shop -- Change Shop To The Name Of The Gui. if dialog.Name=="DialogChoice" then -- Change The Choice1 To The Name Of The Dialog Choice. gui:Clone().Parent = player.PlayerGui end end)
I made a dialog shop that you press a question mark above a bots head and it opens up with questions, you press yes and it opens a GUI. My problem is the GUI will not open when I press Yes
Your LocalScript needs to be a descendant of the player, like StarterCharacterScripts. BillboardGuis and SurfaceGuis are the same. Sure, you can see them, but to register user input, they need to be a part of your player locally.
You can do something like the following. This was a test script, so fix the Parents and names.
~ edit based on Parents image in chat
local model = workspace:WaitForChild('player') local head = model:WaitForChild("Head") local Dialog = head:WaitForChild("Dialog") local gui = Dialog:WaitForChild("Shop") local me = game.Players.LocalPlayer local playergui = me:WaitForChild("PlayerGui") Dialog.DialogChoiceSelected:Connect(function(player,choice) if choice.Name == 'DialogChoice' then gui:Clone().Parent = playergui end end)
Try this:
script.Parent.DialogChoiceSelected:connect(function(player,dialog) local gui = script.Parent.Shop if dialog.Name=="DialogChoice" then local original = gui local copy = original:Clone() copy.Parent = player.PlayerGui end end)