local player = game.Players.LocalPlayer
local text = player.PlayerGui.ScreenGui.TextLabel
local canhit = true
touchpart.Touched:Connect(function(hit)
if canhit == true then
if hit and hit.Parent:FindFirstChild("Humanoid") then
text.Visible = true
end
end
end)
touchpart.Touched:Connect(function(hit)
if canhit == true then
local typeSpeed = 0.05
if hit and hit.Parent:FindFirstChild("Humanoid") then
for i = 1, #text do
text.Text = string.sub(text, 1, i)
task.wait(typeSpeed)
end
end
end
end)```
tryna make a touch dialogue well it did work but i want it to do the typerwriter effect
#Touch dialogue
1 messages · Page 1 of 1 (latest)
typerwriter effect doesnt work for me btw
i mean not in this script
jst help me 🙏
yeah ur doing this the goofy way
as for the type writer effect
that looks fine
oh
that wont work
o
you need to have the full dialogue string somewhere else
otherwise its gonna be cooked
oo k let me try that
local Message = "the dialogue for your game"
but wait wait its a touch dialogue right
then you can do text.Text = string.sub(Message, 1, i)
yeah it will still be touch dialogue
k let me try
you also gotta make sure you debounce it correctly otherwise its gonna run the code more than once
idk how to do that lmao 🙏
u almost had it
with the canhit variable
u just gotta set it to false somewhere
and then set it back to true when its done doing what it needs to do
also use PascalCase or camelCase
almost got me there
it just
feels weird 😭
ok it worked
tysm
awesome