Basically, I am trying to make a script builder with output, but I am having some troubles.
Currently, I am trying to get the value of the Owner value when the script errors, but it does not work.
-- Get the player name local s = game.Workspace local scripts = "Builder, Functions, Initialize, Random Junk" function output(text, recipient, type) -- Output the text to the person with coloring that goes with the message local r = game.Players[recipient].PlayerGui["Output Gui"].Current_Labels.Value if type == "script_error" then -- Initial checks if r == 1 then pos = game.Players[recipient].PlayerGui["Output Gui"].TheWholeShabang.SOutput["Output" .. r].Position.Y.Offset else pos = game.Players[recipient].PlayerGui["Output Gui"].TheWholeShabang.SOutput["Output" .. game.Players[recipient].PlayerGui["Output Gui"].Current_Labels.Value].Position.Y.Offset end local label = Instance.new("TextLabel", game.Players[recipient].PlayerGui["Output Gui"].TheWholeShabang.SOutput) label.Name = "Output" .. r + 1 label.BackgroundTransparency = 1 label.Size = UDim2.new(0,355, 0,50) label.Font = Enum.Font.Arial label.FontSize = Enum.FontSize.Size14 label.TextColor = BrickColor.new(255, 0, 0) label.TextWrapped = true label.TextXAlignment = Enum.TextXAlignment.Left label.TextYAlignment = Enum.TextYAlignment.Top -- Detect how many elements are in the Output Gui before positioning if r == 1 then label.Position = UDim2.new(0,0, 0, pos + 45) else label.Position = UDim2.new(0,0, 0, pos + 15) end -- Set the Instanced label(s) text label.Text = text game.Players[recipient].PlayerGui["Output Gui"].Current_Labels.Value = game.Players[recipient].PlayerGui["Output Gui"].Current_Labels.Value + 1 end end local output_error = coroutine.create(function(source, message, trace) end) game:GetService("ScriptContext").Error:connect(function(message, trace, source) output("Error: " .. message .. " Trace: " .. trace .. ".", source["Owner"].Value, "script_error") if string.gmatch(scripts, source.Name) then print("We don't debug that script!") else end end)
Is there a better way to output errors from a user created script in a script builder to the player? I need to output the error only to the player, not the whole server. If there is a better way other than setting a string value please share below.