Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I have a problem With a Npc's Gui?

Asked by 3 years ago

I have a Npc To where once you Click "Sure" he Destroys And i noticed that after he is destroyed The E Gui To talk is still there and if you click it it just re-does the dialogue again. Here is my code




Local A = Game.Players.LocalPlayer.ScreenGui
Sure.MouseButton1Click:Connect(function()


    if script.Parent.Parent.Parent.TalkGui1.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.TalkGui1.TalkFrame.Dialogue.Text = text:sub(1, i)
            wait(0.04)
        end


        wait(0.5)
        script.Parent.Parent.Parent.ButtonGui1.ButtonFrame.Visible = false
        script.Parent.Visible = false
        game.Players.LocalPlayer.PlayerGui.QuestGui.NoQ:Destroy()
        E.Partee.Transparency = 0
        E.Partww.Transparency = 0
        E.Partpp.Transparency = 0
        wait(2)
        A.ButtonGui:Destroy() <------------------ I tried Destroying the E button by going to the player
        D:Destroy()



    end
end)

~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~ Does anybody have any idea on how to fix this Thanks

Answer this question