local FontLibrary = require(script.Parent:WaitForChild("FontLibrary")) local ExtendedTextLabel = require(script.Parent.FontLibrary:WaitForChild("ExtendedTextLabel")) -- ERROR HERE FontLibrary:LoadFont(338119316) local label = ExtendedTextLabel.new() label.Name = "HUDText" label.Font = "ObelixPro" label.Text = "HI" label.FontSize = 36 label.Position = UDim2.new(0,0,0,0) label.Size = UDim2.new(1,0,0.15,0) label.TextColor = Color3.new(1,1,1) label.Parent = script.Parent.MainHUD
FontLibrary is not a valid member of PlayerGui
It says FontLibrary is not a member of PlayerGui, when if I go into the players GUI it has it their. Please help
EDIT
Requested module experienced an error while loading
Error on line 4
Given the circumstances, I'd say the problem is simply trying to index the PlayerGui
for an object that hasn't loaded yet.
Try using the WaitForChild
method on the PlayerGui
to return then 'FontLibrary', like this:
local FontLibrary = script.Parent:WaitForChild("FontLibrary") -- I also recommend doing the same thing for the "ExtendedTextLabel" local ExtendedTextLabel = require(FontLibrary:WaitForChild("ExtendedTextLabel") FontLibrary = require(FontLibrary)
Anything else that would cause an error would be from the code in the module itself. Remember to have a return value inside each module.
If you're still having trouble with it, let me know.