Error occurred, no output from lua

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)

Here are the errors I am getting:


EDIT: This seems to break on group games only. I can make the decal public or anything, and I get this weird error.

2 Likes

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.

2 Likes

I am importing the image to get its texture. This is the method of many other things such as Basic Admin.

2 Likes

Could you post what the variable Image stands for? It may be something in the string itself.

1 Like

The first image shows the output of image right before it is loaded.

4 Likes

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.

1 Like

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
1 Like

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.

My only other recommendation is to attempt converting the string into an int64 with tonumber(). https://gyazo.com/c9b628abdea3378704368a4edab84257

1 Like

I am testing this in game. If it was needed with a number it would have errored out in my other game.

2 Likes

It shows line 197 and 199, those are the 2 lines of code I showed above.
Also, I coded this myself, I don’t get scripts from other places.

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.

1 Like

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.

  1. executing the code you show there does not allow reproduction of the error you show

  2. the error shows a different function name as the source

image

No point in arguing that it’s the wrong source, it seems.

1 Like

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.