#Touch dialogue

1 messages · Page 1 of 1 (latest)

neat portal
#
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
#

typerwriter effect doesnt work for me btw

#

i mean not in this script

#

jst help me 🙏

sick quarry
#

yeah ur doing this the goofy way

#

as for the type writer effect

#

that looks fine

#

oh

#

that wont work

neat portal
#

o

sick quarry
#

you need to have the full dialogue string somewhere else

#

otherwise its gonna be cooked

neat portal
#

oo k let me try that

sick quarry
#

local Message = "the dialogue for your game"

neat portal
#

but wait wait its a touch dialogue right

sick quarry
#

then you can do text.Text = string.sub(Message, 1, i)

#

yeah it will still be touch dialogue

neat portal
#

k let me try

sick quarry
#

you also gotta make sure you debounce it correctly otherwise its gonna run the code more than once

sick quarry
#

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

neat portal
#

yo tf

#

YO

#

tf

sick quarry
#

?

#

looks cool

neat portal
#

i didnt even update 💔

sick quarry
#

yeah its never been black before

#

this is the future altas

neat portal
#

it just

#

feels weird 😭

#

ok it worked

#

tysm

sick quarry
#

awesome