function setText(word)
for i = 1, text do
textLabel.Text = string.sub(text,1,i)
SoundEffect()
textLabel.TextColor3 = Color3.fromRGB(188, 0, 0)
wait(0.5)
end
end
function setText(word)
for i = 1, text do
textLabel.Text = string.sub(text,1,i)
SoundEffect()
textLabel.TextColor3 = Color3.fromRGB(188, 0, 0)
wait(0.5)
end
end
The problem is that your parameters in setText() is "word" not "text". You need to change it to "text"
Also in line 2 ( for i = 1, text do ), "text" is a string, not amount of digits in it ( #text )
function setText(text)
for i = 1, #text do -- "#text" not "text"
textLabel.Text = string.sub(text,1,i)
SoundEffect()
textLabel.TextColor3 = Color3.fromRGB(188, 0, 0)
wait(0.5)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
What should i write in line 3 as at is saying expected number got nil?