Dialogue wont work

Hey so I made a dialogue script for some reason the dialogue won’t go away


robloxapp-20201120-1225394.wmv (1.9 MB)

Script:
script1

Please let me know if you know what I’m doing wrong. Thanks!

try tweening it to go away if visible does not work

1 Like

Essayez d’utiliser PlayerGui si vous utilisez StarterGui

TouchEnded isn’t a good way to make the ui go away, if you want the dialogue to disappear when player goes far enough (which i think you want), use magnitude

1 Like

In order to make it work you need to use a RemoteEvent to communicate between server (The Part) and client (The UI).

Where is the script? Is it in the textlabel?

Yeah it is inside of the textlabel

Sorry, I can’t help you on this one :frowning:

1 Like

Can you show the code that makes the dialog visible?

TouchEnded is very unreliable and I don’t recommend using it. Also, can you please post the rest of the script so I can see what dialog is defined as?

Heres the whole code:
local part = game.Workspace.Cave1.DialogActivator
local dialog = script.Parent.Dialog1

part.Touched:Connect(function()
dialog.Visible = true
---------------------------
local yes = dialog.Yes
local no = dialog.No
local yes2 = dialog.Yes2
local doneChatting = false
---------------------------
yes.MouseButton1Up:Connect(function()
yes.Visible = false
no.Visible = false
---------------------------
dialog.Text = “Old Man: Hola mi amigo!!!”
wait(1)
dialog.Text = “Old Man: its danger to alone take sword XD”
---------------------------
yes2.Visible = true
end)

yes2.MouseButton1Up:Connect(function()
	local swordGiver = game.Workspace.Cave1.Sword1Giver
	local sword = game.Workspace.FirstSword
	---------------------------
	swordGiver.Touched:Connect(function(player)
		local humanoid = player.Parent.Humanoid
		humanoid:EquipTool(sword)
		doneChatting = true
		if doneChatting == true then
			swordGiver:Destroy()
			dialog.Text = "goodbye :("
		end
		
		if doneChatting == true then
			yes2.Visible = false
		end
	end)
end)

no.MouseButton1Up:Connect(function()
	yes.Visible = false
	no.Visible = false
	---------------------------
	dialog.Text = "Old Man: You shall pay for what you have said...."
	wait(0.8)
	---------------------------
	dialog.TextColor3 = Color3.new(1, 0, 0)
	---------------------------
	dialog.Text = "Old Man: Die"
	wait(0.8)
	---------------------------
	local lava = game.Workspace.Cave1.Lava
	---------------------------
	lava.Transparency = 0.4
	---------------------------
	lava.Touched:Connect(function(hit)
		hit.Parent:FindFirstChild("Humanoid")
		hit.Parent.Humanoid.Health = 0
	end)
	wait(0.8)
	lava.Transparency = 1
end)

end)

part.TouchEnded:Connect(function()
dialog.Visible = false
end)

Here’s the whole code:
local part = game.Workspace.Cave1.DialogActivator
local dialog = script.Parent.Dialog1

part.Touched:Connect(function()
dialog.Visible = true
---------------------------
local yes = dialog.Yes
local no = dialog.No
local yes2 = dialog.Yes2
local doneChatting = false
---------------------------
yes.MouseButton1Up:Connect(function()
yes.Visible = false
no.Visible = false
---------------------------
dialog.Text = “Old Man: Hola mi amigo!!!”
wait(1)
dialog.Text = “Old Man: its danger to alone take sword XD”
---------------------------
yes2.Visible = true
end)

yes2.MouseButton1Up:Connect(function()
	local swordGiver = game.Workspace.Cave1.Sword1Giver
	local sword = game.Workspace.FirstSword
	---------------------------
	swordGiver.Touched:Connect(function(player)
		local humanoid = player.Parent.Humanoid
		humanoid:EquipTool(sword)
		doneChatting = true
		if doneChatting == true then
			swordGiver:Destroy()
			dialog.Text = "goodbye :("
		end
		
		if doneChatting == true then
			yes2.Visible = false
		end
	end)
end)

no.MouseButton1Up:Connect(function()
	yes.Visible = false
	no.Visible = false
	---------------------------
	dialog.Text = "Old Man: You shall pay for what you have said...."
	wait(0.8)
	---------------------------
	dialog.TextColor3 = Color3.new(1, 0, 0)
	---------------------------
	dialog.Text = "Old Man: Die"
	wait(0.8)
	---------------------------
	local lava = game.Workspace.Cave1.Lava
	---------------------------
	lava.Transparency = 0.4
	---------------------------
	lava.Touched:Connect(function(hit)
		hit.Parent:FindFirstChild("Humanoid")
		hit.Parent.Humanoid.Health = 0
	end)
	wait(0.8)
	lava.Transparency = 1
end)

end)

part.TouchEnded:Connect(function()
dialog.Visible = false
end)

1 Like