RbxUtility fails to load in client-side scripts usually in the nighttime

Client-side scripts that call LoadLibrary('RbxUtility') seem to fail often times during the nighttime after installing a new Roblox update, issuing this error:

107e0115ac92655ae3777858e93632129ecc3b6e.jpg

After a couple of hours, it usually begins to work again normally. This doesn’t seem to affect Studio, however.

3 Likes

This is a MASSIVE issue. I have had to close down my game until this issue gets reverted or fixed. It has completely broken the game since it relies on this library heavily.

Not sure if time of day effects it, myn seems to be broken at any time of day but I’ve only had limited time to test. It seems to be local scripts only.

Edit:
Here’s a test place with a script in Workspace and a LocalScript in PlayerGui that both load the library. If you upload it to roblox and play you will see in the console that the LocalScript errors.

RbxUtilityTest.rbxl (10.9 KB)

Edit: This same error seems to occur with the RbxGui library too. Maybe it’s an issue with LoadLibrary

1 Like

I’ve always felt weird about the random LoadLibrary stuff. What are you using it for?

One of our coders @Luckymaxer uses the create function a lot for doing stuff like this for NPC dialog:

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

local prompt = Create("TextLabel"){
		Name = "UserPrompt",
		BackgroundTransparency = 1,
		Font = Enum.Font.SourceSans,
		FontSize = FontSize,
		Position = UDim2.new(0, 40, 0, 0),
		Size = UDim2.new(1, (-32 - 40), 1, 0),
		TextXAlignment = Enum.TextXAlignment.Left,
		TextYAlignment = Enum.TextYAlignment.Center,
		TextWrap = true,
		Parent = frame,
		TextScaled = TextScaled,
	}

I’m not sure what the exact reason for using it is, I guess it keeps stuff cleaner and easier to read.
It’s also used in lots of other places so I’m going to have to go through and change it all to Instance.new if nothing is done about it.

Perhaps just switch to loading in your own module that does the same thing? It’s really easy to remake the Create function, if I’m understanding it properly:

local RbxUtility

xpcall(function()
	RbxUtility = LoadLibrary("RbxUtility")
end, function()
	RbxUtility = {}
	function RbxUtility.Create(class)
		local obj = Instance.new(class)
		return function(properties)
			for prop,val in pairs(properties) do
				obj[prop] = val
			end
			return obj
		end
	end
end)

1 Like

Thanks a lot, that could actually save a lot of time :slight_smile:

Your code seems to be erroring at line 50 or I’m implementing it wrong.

It seems to be an issue with all libraries or the LoadLibrary method since I’ve just noticed the same thing is happening for the RbxGui library which is less important.

How are you calling it? Seems like you’re feeding a table like {Workspace,...} rather than {Parent=Workspace,...}.

Here’s two examples of how it’s called.

PointerMesh = Create("BlockMesh"){
    Name = "Mesh",
    Scale = Vector3.new(1, 0.5, 1),
    VertexColor = Vector3.new(1, 1, 1),
    Offset = Vector3.new(0, 0, 0),
    Parent = BasePointer,
}

Cursor = Create("ScreenGui"){
	Name = "Cursor",
	Create((OnMobile and "ImageButton") or "ImageLabel"){
		Name = "Icon",
		BackgroundTransparency = 1,
		BorderSizePixel = 0,
		ZIndex = 1,
		Image = "",
		Size = UDim2.new(0, 25, 0, 25),
		Create("TextLabel"){
			Name = "HelpText",
			BackgroundTransparency = 1,
			BorderSizePixel = 0,
			ZIndex = 1,
			Text = "Tap the cross to throw",
			TextColor3 = Color3.new((255 / 255), (255 / 255), (255 / 255)),
			TextStrokeColor3 = Color3.new((0 / 255), (0 / 255), (0 / 255)),
			TextStrokeTransparency = 0.75,
			Font = Enum.Font.Arial,
			FontSize = Enum.FontSize.Size18,
			Position = UDim2.new(1, 0, -0.75, 0),
			Size = UDim2.new(3, 0, 1, 0),
			Visible = false,
		}
	}
}

In the second example, the Icon object does not have any index given in the table, so that will be placed at index 1. And then the Create code tries to assign Cursor[1] = Icon which is impossible because there’s no property “1” of Cursor.

You’ll still need to add some code to the custom Create that puts objects in the table (that are at numerical indices) as children of the object you’re creating. Then it’ll work like you expect it to.

1 Like

Altered Crazyman’s code slightly to work for your example

local RbxUtility

xpcall(function()
	RbxUtility = LoadLibrary("RbxUtility")
end, function()
	RbxUtility = {}
	function RbxUtility.Create(class)
		local obj = Instance.new(class)
		return function(properties)
			local par
			for prop, val in next, properties do
				if prop == "Parent" then
					par = val
				elseif typeof(val) == "Instance" then
					val.Parent = obj
				else
					obj[prop] = val
				end
			end
			if par then obj.Parent = par end
			return obj
		end
	end
end)
1 Like

That’s brilliant. Thanks so much for your help guys, it’s back to working condition.

This really needs to be fixed, I use some of the stock sliders and dropdown menus provided by RbxGui and they’ve all broken.

3 Likes

Yeah, the Play button in my game uses CreateSignal() in RbxUtility. My game is borked on PC until this is fixed or until I can find a workaround.

Number of sessions that lasted less than 2 minutes in my game in the past day:

1 Like

This should be fixed now.

1 Like

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