This is eating my brain and i can't figure out the answer

the below script is supposed to check if an error appears in the output and prints it in a textlabel. here’s the issue:


the Text property shows the error, but it doesn’t show the text on client or server.
(this is all in a localscript)

local MS = game:GetService("LogService")
local ei =  game.StarterGui.ErrorUI
local ts = game:GetService("TweenService")

MS.MessageOut:Connect(function(msg, t)
	local TwI = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	if t == Enum.MessageType.MessageError then
		local Warning = ei.Warning
		
		Warning.Position = UDim2.new(1, 0, 0.6, 0)
		Warning.Visible = true
		ts:Create(Warning, TwI, {Position = UDim2.new(0.7,0,0.6, 0)}):Play()
		Warning.Text = msg
		game.SoundService.sound_effect.output_error:Play()
	end
end)
wait(1)
error("sd", 1)

You’re defining the Element that is being cloned to the client on joining the server and/or on spawn not the one that is visible to the client which is located under the Player instance > PlayerGui.
You should be defining the gui like that:

local ei =  game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ErrorUI")
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.