I want to make a dialog choice to makes a ui visible. The problem is that it prints out the gun but it still wont make it visible. This is a local script because it doesn’t work on server scripts. Here is a vid and the code
local dialog = game.Workspace.Cashier.Head.Dialog
dialog.DialogChoiceSelected:Connect(function(player, choice)
print(choice)
if choice == "gun" then
script.Parent.Visible = true
end
end)
Really simple fix!
You’re using an if statement to detect if there is a string named “gun”, however, this is not how you utilize it.
Rather, you will detect if the user selects the correct option.
local dialog = game.Workspace.Cashier.Head.Dialog
local guiFrame = script.Parent
dialog.DialogChoiceSelected:Connect(function(player, choice)
if choice == dialog["Rent A Gun"] then
script.Parent.Visible = true
end
end)
Your explorer setup should look something like this.