-
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)
-
Issue is, I don’t know what to do to make it.
-
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
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
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