Hey, can you make a custom chat messages using this script: local maxCharsPerLine = 24
function response(text)
-- remove newlines first
text = text:gsub("\r?\n", " ")
local lines = math.ceil(#text / maxCharsPerLine)
print("Lines:", lines)
my.text.content = text
if lines == 1 then
my.layout.widthScale = math.min(math.max((#text * 0.25), 0.5), 3)
end
if lines ~= 1 then
my.variables.offset = lines * 0.25 - 0.25
my.layout.widthScale = 3
end
end
function onMessage(msg)
castle.getTextInput(function(text, canceled)
if not canceled then
response(text)
my.text.opacity = 1
castle.runAfterDelay(5, function()
my.text.opacity = 0
end)
end
end)
end