I have tried many things but none will work. Importing old scripts wont work either.
local shopguy = workspace.Map.Tom.ClickDetector
local NPCname = gui.NPCName.Text
local dialogue = gui.Dialogue.Text
local dialoguedb = false
Player = game:GetService("Players")["LocalPlayer"]
local playername = Player.Name
local char = Player.Character
local hum = char:WaitForChild("Humanoid")
shopguy.MouseClick:Connect(function()
if not dialoguedb then
dialoguedb = true
gui.Enabled = true
NPCname.Text = "Tom"
local line1 = "Hey! Want to buy something from my shop? I've got all sorts of stuff!"
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = shopguy.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
local shopgui = script.Parent.ShopGUI
shopgui.Enabled = true
end
end)
It's a physical click that brings up a GUI and when the dialogue is finished it brings up another.
