Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

My text auto scale is not sizing the text correctly?

Asked by 4 years ago
Edited 4 years ago

Hello, i'm making and admin GUI, i have completed some parts of it but i added it auto scale, but i dont want to use TextScaled since it can size it to 100, so i made this

function SendMessage(Message,Type)
-- Here its only making the msg
    local Output = script.Parent.Console.Output
    local MSGTXT = script.Parent.Console.Txt:Clone()
    MSGTXT.Text = Message
    if Type == "error" then
        Type = Color3.fromRGB(255,0,0)
    end
    if Type == "say" then
        Type = Color3.fromRGB(255,255,255)
    end
    if Type == "green" then
        Type = Color3.fromRGB(125,255,0)
    end
    if Type == "warning" then
        Type = Color3.fromRGB(255,90,0)
    end
    MSGTXT.Parent = Output
    MSGTXT.Name = Message
    MSGTXT.TextColor3 = Type
    MSGTXT.Font = Font -- Font is saved in dataStore
MSGTXT.Parent = Output
MSGTXT.Visible = true 

local function redo() -- here you start scaling
if MSGTXT.TextFits == false then
    MSGTXT.TextSize = MSGTXT.TextSize-1
    if MSGTXT.TextFits == false then
        redo()
    end
end
end
redo() -- make the text fit to its size

end

My problem is that it sizes it to almost 0 the worst is that it fits but it still loops, what could i do to fix this? Error:

Could not display entire 1441791 character message because message exceeds max displayable length of 16839

1 answer

Log in to vote
2
Answered by 4 years ago

the redo loops it so you would want

function SendMessage(Message,Type)
-- Here its only making the msg
    local Output = script.Parent.Console.Output
    local MSGTXT = script.Parent.Console.Txt:Clone()
    MSGTXT.Text = Message
    if Type == "error" then
        Type = Color3.fromRGB(255,0,0)
    end
    if Type == "say" then
        Type = Color3.fromRGB(255,255,255)
    end
    if Type == "green" then
        Type = Color3.fromRGB(125,255,0)
    end
    if Type == "warning" then
        Type = Color3.fromRGB(255,90,0)
    end
    MSGTXT.Parent = Output
    MSGTXT.Name = Message
    MSGTXT.TextColor3 = Type
    MSGTXT.Font = Font -- Font is saved in dataStore
MSGTXT.Parent = Output
MSGTXT.Visible = true 

local function redo() -- here you start scaling
if MSGTXT.TextFits == false then
    MSGTXT.TextSize = MSGTXT.TextSize-1
    if MSGTXT.TextFits == false then
        redo()
    end
end
end
1
i changed the bottom redo because that seemed to loop it on my side EnzoTDZ_YT 275 — 4y
1
Actually no, redo is not being called maumaumaumaumaumua 628 — 4y
1
exactly i changed it EnzoTDZ_YT 275 — 4y
Ad

Answer this question