How would I make a dialogue based system?

  1. I wanna make a dialogue system, and the text gets typed as the player is in it. (If it’s possible, I would like if they are too far, they can’t enter the dialogue)

  2. Issue is, I don’t know what to do to make it.

  3. I’ve looked around a bit, but I havent found anything.

1 Like

(I would also want it to be NPC based (clicking an NPC)

1 Like

Is this what your looking for? https://www.youtube.com/watch?v=RLXjta2F7Zw&t

2 Likes

Kind of, but doesn’t really break it down for me. I’m trying to get a better example so I can do it in the future more often without looking back

local function typetext(text)
for i=1,#text,1 do
script.Parent.Textlabel.Text = string.sub(text,1,i)
wait(#text/10)
end
end
typetext("ello im a spy")
2 Likes

So I tried that, and it only brang up Label

local intext = false

local function typetext(text)

for i=1,#text,1 do

script.Parent.Textlabel.Text = string.sub(text,1,i)

wait(#text/7)

end

end

game.Workspace.AceTheValliantHero.ClickDetector.MouseClick:Connect(function()

if not intext then

intext = true

script.Parent.Visible = true

typetext("Whats up")

script.Parent.Visible = false
intext = false

end

end)

Yes, the localscript and the frame is in StarterGUI parented by a ScreenGUI

U should add a RemoteEvent that fires the client :slight_smile:

Where would I use the remoteevent in the script? And would it be in a localscript? Sorry for the late response.

Nevermind, I fixed it, but the text appears too slow, any fix?

Here’s the localscript

local intext = false
local function typetext(text)
	for i=1,#text,1 do
		script.Parent.TextLabel.Text = string.sub(text,1,i)
		wait(#text/7)
	end
end
game.Workspace.AceTheValliantHero.ClickDetector.MouseClick:Connect(function()
	if not intext then
intext = true	
script.Parent.Visible = true
	typetext("Whats up")
		script.Parent.Visible = false
		intext = false
		end
end)
local intext = false
local function typetext(text)
	for i=1,#text,1 do
		script.Parent.TextLabel.Text = string.sub(text,1,i)
		wait(.5)
	end
end
game.Workspace.AceTheValliantHero.ClickDetector.MouseClick:Connect(function()
	if not intext then
intext = true	
script.Parent.Visible = true
	typetext("Whats up")
		script.Parent.Visible = false
		intext = false
		end
end)
2 Likes