I am using InsertService and when it tries to import an image, it says “Error occurred, no output from lua” This same exact script I am using worked on my other game but seems to not in this game. I have purged any scripts that may interfere with this but the remaining scripts wouldn’t get in the way.
Here is line 197-199
print("Loading", Image, Text)
local ImageModel = InsertService:LoadAsset(Image)
I don’t believe the InsertService is the correct way to load an image. What you want to do is use ContentProvider:PreloadAsync(). However, if you do need the InsertService, and you know what you’re doing with that, please post what the variable Image stands for. It should be a numerical string representing the model’s asset id.
Unfortunately, I can’t go off this very well. I will assume all your variables are correct and say there aren’t any noticeable issues.
Make sure you’ve parented the instance to something.
Output from Lua not occurring (like here) means there’s an issue in the code itself.
To fully understand what we’re dealing with, more code would be useful. Not just a variable that we assume is the correct way to deal with this. (i.e. InsertService is probably game:GetService(“InsertService”), but we don’t know that.)
More assistance on your end would be helpful to navigating the problem.
I cannot parent anything if it will not load.
This code works fine in another game as stated.
Here is some more code:
if c.name == "Text" then
for i = 0, 1.05, .05 do
if ImageFrame.Visible then
ImageFrame.txt.TextTransparency = i
ImageFrame.logo.ImageTransparency = i
elseif TextFrame.Visible then
TextFrame.txt.TextTransparency = i
end
wait(.0025)
end
local Text = string.split(c.desc, 'Text: ')[2]
TextFrame.Visible = true
ImageFrame.Visible = false
TextFrame.txt.Text = Text
chat:Chat(NPC.Head, Text, Enum.ChatColor.White)
for i = 0, 1.05, .05 do
TextFrame.txt.TextTransparency = 1 - i
wait(.0025)
end
elseif c.name == "Image" then
for i = 0, 1.05, .05 do
if ImageFrame.Visible then
ImageFrame.txt.TextTransparency = i
ImageFrame.logo.ImageTransparency = i
elseif TextFrame.Visible then
TextFrame.txt.TextTransparency = i
end
wait(.0025)
end
local Text = string.split(c.desc, 'Text: ')[2]
local Image = string.split(Text, 'Image: ')[2]
if not Image then
local userid = getNumber(string.split(Text, 'Avatar: ')[2])
Image = "https://www.roblox.com/headshot-thumbnail/image?userId="..userid.."&width=420&height=420&format=png"
Text = string.split(Text, 'Avatar: ')[1]
TextFrame.Visible = false
ImageFrame.Visible = true
ImageFrame.logo.Image = Image
ImageFrame.txt.Text = Text
else
Text = string.split(Text, 'Image: ')[1]
Image = getNumber(Image)
print("Loading", Image, Text)
local ImageModel = InsertService:LoadAsset(Image)
local Image = ImageModel:FindFirstChildOfClass("Decal")
Image.Parent = workspace
ImageModel:Destroy()
TextFrame.Visible = false
ImageFrame.Visible = true
ImageFrame.logo.Image = Image.Texture
Image:Destroy()
ImageFrame.txt.Text = Text
end
chat:Chat(NPC.Head, Text, Enum.ChatColor.White)
game:GetService("ContentProvider"):PreloadAsync({ImageFrame.logo.Image})
for i = 0, 1.05, .05 do
ImageFrame.txt.TextTransparency = 1 - i
ImageFrame.logo.ImageTransparency = 1 - i
wait(.0025)
end
elseif c.name == "Transition" then
for i = 0, 1, .05 do
ImageFrame.txt.TextTransparency = i
ImageFrame.logo.ImageTransparency = i
TextFrame.txt.TextTransparency = i
wait(.0025)
end
ImageFrame.txt.TextTransparency = 1
ImageFrame.logo.ImageTransparency = 1
TextFrame.txt.TextTransparency = 1
ImageFrame.Visible = false
TextFrame.Visible = false
warn'inviis'
fadeIn(uiLogo)
end
If it works in another game, and assuming you’re testing this in studio, have you made sure Studio Access to API is enabled?
If you have tested this outside of studio, in game, I can’t help you by my current knowledge as it would appear to be an issue with your game or on Roblox’s end.
Again, this is not the correct script since clearly it’s not defining the function as described in the error traceback.
Whether you wrote it yourself and don’t have any recollection of what you wrote or didn’t write it makes no real difference; it’s very difficult to help you if you don’t show the actual problematic code.
I showed the code where I said “Here is line 197-199 (code)”. Also, as shown in my images, it says “ServerScriptService.Script”, Line 199
“ServerScriptService.Script”, Line 197
This says there are errors on line 197 and 199, and I showed the problematic code.
The function is too long to show the whole thing. This is inside of the function. I am 100% this is the line erroring out. You can see the reply I made if you wish to see more code, but the output shows that everything is in check when trying to insert the asset.