How to make print output only 1 part of information

Hi, im trying to make a module script output the name of the item it chose, however it leaves me with a huge paragraph when i print it


is there a way i can get rid of the rest of the paragraph but keeping the name at the very start


local b = require(game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Modules"):WaitForChild("case"))
print(b.newResult)

module script

local item 
	for a,b in ipairs(m.settings.objects) do
		local left,right = b.AbsolutePosition.X/m.settings.cUI.AbsoluteSize.X, (b.AbsolutePosition.X+b.AbsoluteSize.X)/m.settings.cUI.AbsoluteSize.X
		
		if left<=0.5 and right >=0.5 then item=b break end
	end
	if item then
		m.newResult = item
	else
		local closestItems = {}
		for a,b in ipairs(m.settings.objects) do  
			table.insert(closestItems,{
				mag=(Vector2.new(b.AbsolutePosition.X/m.settings.cUI.AbsoluteSize.X,0)-Vector2.new(0.5,0)).magnitude;
				item=b;    
			})
		end
		table.sort(closestItems,function(a,b) return a.mag<b.mag end)
		m.newResult = closestItems[1].item
		
	end
end

function m:create(caseType)
	--Settings
	m.settings = { 
		case = items.Cases[caseType];
		cUI = elements:WaitForChild("caseUI"):Clone();
		objects = {};
		prng = Random.new();
		offset = UDim2.new(0,25,0,0);
		accel = 30;
		speed = 2;
		spinLength = 7;
	}
	m.newResult=nil

	--PreSetup
	m.settings.cUI.Parent = ui
	for t=1,100 do
		m:createItem()
	end 

	--Services
	m.render = game:GetService("RunService").RenderStepped:connect(function()
		m:update()
		m:check()
	end)

	--Wait for result
	repeat wait() until m.newResult

	--Get rid of ui 
	spawn(function()
		wait(2)
		m.settings.cUI:TweenPosition(UDim2.new(0,0,1.15,0),"Out","Sine",1,true,function() m.settings.cUI:Destroy() end)
	end)

	--Return result
	return m.newResult
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Hello!
You didn’t specify which attribute to show, so it displays all the information.

print(b.newResult.Name)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.