Error with LoadAsset()?

Hi,

I seem to be getting an error with the LoadAsset() function on my game. I’m trying to make something that can be taken and used (uncopylocked) by others, and a lot of the game runs based on a ModuleScript. For some reason when I try to load the ModuleScript from ROBLOX I get an error, even though the Model is uncopylocked. I get an error when it’s done using another person’s account, but if it’s on my own account I get no errors - yet it is uncopylocked.

InsertService = game:GetService(“InsertService”)
game.Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(Char)
local success, message = pcall(function()
Asset = InsertService:LoadAsset(3342140587)
end)
if success then
local ToolModule = Asset:GetChildren()[1]
ToolModule.Parent = Plr.Backpack
else
warn(“Error loading module”)
end
end)
end)

Anyone know anything about this?

1 Like

Hey, I Have the same error I think, The game is not loading?

The player needs to own the item you’re trying to insert.

If you’re trying to insert a script with load asset, you could just take the same script and replicate it through a service.

You could also require the script if it is module.

local asset = require(3342140587);
--// You can then use this as a module.
--// Keep in mind the module name would need to be "MainModule"
1 Like