I’m trying to make a custom GUI dialogue system where there is one ScreenGui for every NPC. This is my script:
local clickdetector = game.Workspace.npc1.Head.ClickDetector
local dialogue = game.StarterGui.DialogueGui1
local npctext = game.StarterGui.DialogueGui1.MainFrame.PromptImage
dialogue.Transparency = 1
clickdetector.MouseClick:Connect(function()
wait(0.2)
dialogue.Transparency = 0.9
dialogue.Transparency = 0.7
dialogue.Transparency = 0.5
dialogue.Transparency = 0.3
dialogue.Transparency = 0
wait(0.1)
npctext.PromptText.Text = ("Hello there!")
wait(5)
dialogue.Transparency = 1
end)
However, when I test it, the ScreenGui’s transparency doesn’t change (it stays 100% visible even before I click the NPC) and the ScreenGui’s dialogue text (npctext.PrompText) doesn’t make the text box show text as well. What am I doing wrong, and how can I fix it?