Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i do this text thing with a script?

I've seen games where it displays text one character at a time, even when it is using strings like this:

t  =  ..game.Workspace.Part.Rotation.."CoolDudeGuyMan"

how would I do this in my scripts? Is there something so obvious I'm missing?

1 answer

✓ Accepted answer

Do you mean like type the text out?

If so then what you need to do is first make a constant loop, a while loop;

while wait() do --You can just put wait in the definition of the while
	
end

Now, you need to have a for loop to type out the string one by one, but don't forget to define the string.

The definition of your string will need to involve the concatenation of the property's value.

--[[Because the rotation property is actually a userdata value, you cannot directly concatenate it.. so you need to concatenate all of the elements]]
local p = workspace.Part
local Str = p.Rotation.X..", "..p.Rotation.Y..", "..p.Rotation.Z.." CoolDudeGuyMan"

--Now make the for loop. Substitude the end increment for the length of 'Str'.
for i = 1,#Str do
	--Now get the part of the string that correlates to the for's iteration
	t = Str:sub(0,i)
	print(t)
	wait(.1) --This is the yeild between letters
end

Now put the for loop inside the while loop.

while wait() do
	local p = workspace.Part
	local Str = p.Rotation.X..", "..p.Rotation.Y..", "..p.Rotation.Z.." CoolDudeGuyMan"
	for i = 1,#Str do
		t = Str:sub(0,i)
		print(t)
		wait(.1)
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.