Alright well I haven’t completely finished it but heres a working prototype, I can’t quite fix the issues yet, but I will be able too try and fix them in a few minutes, in the meantime if you want to try here you go
LocalScript inside the TextBox:
local maxLength = 20 -- Max Letters Per Line
local scriptChanged = false
script.Parent:GetPropertyChangedSignal("ContentText"):Connect(function()
local text = script.Parent.ContentText
if text:len() > maxLength and not scriptChanged then
local firstLine = text:sub(1, maxLength)
local nextLine = text:sub(maxLength, -1)
scriptChanged = true
script.Parent.Text = string.format(firstLine.."\n"..nextLine, "%q")
else
wait(2)
scriptChanged = false
end
end)
is there anyway to do it with the TextFits
property? so it adds a new line everytime it reaches the end of the textbox and not with a max length
TextFits would probably work for the first beeline but every line after that it probably wouldn’t work for
yeah, I tried it with this script and this happened
oh, wow. thank you, this would work since it’s not really the player typing in the text box but my type writing script so no need to worry of not being able to type in the middle (still does kind of work when i type in the middle). also it does work with fast typing and copy pasting. thank you, i really appreciate it!
oh wait, it bugs with the type writing script?
this happens
i used a textbox instead of a textlabel so i can add a placeholder text, it’s easier than making a script to type the “Enter a prompt…”
That’s because the workaround was intended for user input, not script input. I didn’t know you were going to use script input. Typically, TextBoxes are reserved for the user while TextLabels are used by scripts. This is going to need a different approach to workaround these issues.