Hello devs, So I am using Topbar+, but when I do Module.new() it errors, the error is require(assetId) can't be used in client.
.
Because you can’t require modules by id from the client.
You can get the module and place a hard copy in ReplicatedStorage
Well I did that but didn’t do anything.
Really?
if you place the module in ReplicatedStorage and do
local Topbar = require(game.ReplicatedStorage.TopbarModule) -- or whatever its name is
-- do your code
Topbar.new()
Yes I did that, it errored, and Roblox wont let me do shorter sentences so making this longer
local Topbar = require(game:GetService("ReplicatedStorage"):WaitForChild("TopbarModule")) -- or whatever its name is
-- do your code
Topbar.new()
May need to do this, don’t give me the solution mark if this works.
Well my code checks if game Is loaded so that won’t do anything.
Are you sure? Give it a try still.
This is at the top repeat task.wait() until game:IsLoaded()
Its quite simple, place the module like so
and the follow code should work
local Topbar = require(game.ReplicatedStorage.Icon)
Topbar.new()
-- do code
I…Did…Put…Module…In…Replicated…Storage!
Ok cool, then it should work if you did
Well It didn’t, it showed same assetId error.
Show me your code where the error happens then
I did that to the module when I was fixing issue, but when It didn’t work I deleted it
But It was when I used Module.new()
Still works fine for me, maybe show us your code so we could actually diagnose the problem?
I don’t see anything wrong with that. Are you sure it still errors cause I don’t see any id requires.