So ive made a Diolauge System and When the Player clicks the option "Sure" I want A text Label to destroy. But thats the part im stuck on so could anyone help me. Here is the code
Local D = game.StartergGui.QuestGui.NoQ
Sure.MouseButton1Click:Connect(function() D:Destroy() <----------- That is the destroy code that doesent work
if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Hey kid Can you Do somthing for me?" then local text = "Well i cant find My radio, last time i saw it I was at this abbandoned place" local length = string.len(text) for i = 1, length do script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i) wait(0.04) end wait(0.5) script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false script.Parent.Visible = false end
end)
Sure.MouseButton1Click:Connect(function()
game.StarterGui.QuestGui.NoQ:Destroy() <-------------- This is the code if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Hey kid Can you Do somthing for me?" then local text = "Well i cant find My radio, last time i saw it I was at this abbandoned place" local length = string.len(text) for i = 1, length do script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i) wait(0.04) end wait(0.5) script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false script.Parent.Visible = false end
end)
first I tried making a local Script then i tried doing it without the local script.
game.StarterGui are the Guis, that get loaded into the "PlayerGui" each player has it's own PlayerGui, only accessible by the server or the local Client. So you have to get the LocalPlayer.
local D = game.Players.LocalPlayer.PlayerGui.QuestGui.NoQ Sure.MouseButton1Click:Connect(function() D:Destroy() end)