Localscript not printing any output or any errors

Alright so, I’m working on a note system and I ran into a issue where my localscript doesn’t print any prints or any errors in the output, even though it should technically work. Its supposed to loop through a folder of notes, and then when a billboard is clicked (aka DIY proximity prompt) it starts a local function and sends in the billboard and its descendants. Any ideas what I’m missing here?

Its located in StarterPlayerScripts

local notesFolder = workspace.GeneratedRoomsFolder.GeneratedGasPipeRooms:WaitForChild("Connector").Notes
local player = game:GetService("Players").LocalPlayer


local function onNoteClicked(note, pickUpIcon)
	print("function started")
	local noteParent = note.Parent
	
	note.Enabled = false
	
	for i, v in pairs(player.PlayerGui.NoteGui.MainFrame.NoteUIFolder:GetChildren()) do
		
		if noteParent.Name == v.Name then
			
			local SpecificNoteGui = player.PlayerGui.NoteGui.MainFrame.NoteUIFolder:FindFirstChild(v.Name)
			SpecificNoteGui.Visible = true
			
			SpecificNoteGui.MouseButton1Click:Connect(function()
				
				SpecificNoteGui.Visible = false
				note.Enabled = true
				
			end)
			
		end
		
	end
	
end


for _, note in pairs(notesFolder:GetDescendants()) do
	print("looped through note folder")
	if note:IsA("BillboardGui") then
		print("found billboard")
		local Icon = note.PickUpIcon
		
		Icon.MouseButton1Click:Connect(onNoteClicked(note, Icon))
		print("clicked on icon")
		
	end
	
end

Any help would be greatly appreciated!

2 Likes

Could WaitForChild be infinitely yielding?

3 Likes

Please check if there was is a object named Connecter under GeneratedGasPipeRooms. If not, then your script is running into a infinite yield error because there is no child of GeneratedGasPipeRooms named Connecter

1 Like

Try switch this to:

Icon.MouseButton1Click:Connect(function()
   onNoteClicked(note, Icon)
end)
1 Like