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

How would I print indexes of LogService:GetLogHistory()?

Asked by 9 years ago

The API on the wiki didn't help me at all, it only showed me the syntax, but I have no clue how to use it. I'm working on an AdminGui, and one of the features is that you can script from it. But if it errors, the user doesn't know what is erroring.

I know GUIs don't pick up prints, but I if I know how to print it, then I'll have some knowledge on how to use it, and from there I can expand on my own.

So, how would I use this? (And yes, I have tried to print it already.)

0
Have you tried pressing F9 in game? That will show you game script errors hiccup111 231 — 9y
0
I wanted to make an Output GUI for all players (Which I have, I just got done with it.), so they can see Server errors, and not local errors, or whatever they're called. MINEBLOX106 55 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Got it fixed and added successfully. Here's my script:

function add(name)
    local o = Instance.new("TextLabel", script.Parent.EffectFrame.Frame)
    o.BackgroundTransparency = 1
    o.BorderSizePixel = 0
    script.Parent.k.Value = script.Parent.k.Value + 25
    o.Position = UDim2.new(0, 0, 0, script.Parent.k.Value)
    o.Size = UDim2.new(1,0,0,25)
    o.FontSize = "Size14"
    o.Name = name
    o.TextColor3 = Color3.new(255,255,255)
    o.TextWrapped = true
    return o
end
game:GetService("LogService").MessageOut:connect(function(Message, Type)
    local msg = add(tostring(Type))
    msg.Text = Message
end)
Ad

Answer this question