local function typewriter(textObj, statement)
textObj.Text = ""
for i = 1, #statement, 1 do
textObj.Text = string.sub(statement, 1, i)
wait(0.05)
end
end
task.spawn(typewriter(cstext, "Ciao!"))
I get this error:
I tried looking at the documentation for spawn, but I didn’t understand what it was saying. I feel like this isn’t a hard problem to solve, but thanks for informing me anyways.
local function typewriter(textObj, statement)
textObj.Text = statement
label.MaxVisibleGraphemes = 0
for i = 1, #statement do
label.MaxVisibleGraphemes = i
task.wait(0.05)
end
end
task.spawn(typewriter, cstext, "Ciao!")
It’s important to understand how function arguments work. In this scenario, you’re not providing a function object, rather, you’re attempting to execute a function call within the arguments of another function call.
Although I haven’t seen or tried the solution @napastnikiek1 mentioned, all the suggestions on here should work to my knowledge. And there’s another way to do this too: