I can't get the descendants of ServerStorage with a RemoteFunction

Hello, I’ve been trying to do something where you can search for a tool to give to a user, and it will display the tools found from the text in the TextBox in a scrolling frame. I’ve used a RemoteFunction to get those tools from the ServerStorage. However, for some reason when I do a for loop to go through every tool in the table that gets returned from GetDescendants(), none of the code in the for loop executes. Most likely because it’s an empty table, but I printed it out and it isn’t.

Client Code:

local playerName = script.Parent.Parent.ToolName
local player = game.Players.LocalPlayer

local tools = game.ReplicatedStorage.GetTools:InvokeServer()

playerName:GetPropertyChangedSignal("Text"):Connect(function()
	for i,v in pairs(script.Parent:GetChildren()) do
		if v:IsA("ImageLabel") and v.Name ~= "ToolExample" then
			if not string.find(string.lower(v.Name), string.lower("^"..playerName.Text)) or playerName.Text == "" then
				v:Destroy()
			end
		end
	end
	
	if playerName.Text ~= "" then
		for i,v in pairs(tools) do
			if string.find(string.lower(v.Name), string.lower("^"..playerName.Text)) and not script.Parent:FindFirstChild(v.Name) then
				local tool = script.Parent.ToolExample:Clone()
				tool.Name = v.Name
				tool.ToolName.Text = v.Name
				tool.Visible = true
				tool.Parent = script.Parent
				print(v.Name)
			end
		end
	end
	
	script.Parent.Visible = true
end)

Server Code:

game.ReplicatedStorage.GetTools.OnServerInvoke = function()	
	return game.ServerStorage:GetDescendants()
end

(Btw I didn’t rename the playerName variable to toolName.)

The contents of ServerStorage are inaccessible to clients. If you would like for clients to see them, move them to ReplicatedStorage. If you just need the names of the tools, you can do this:

local descendants = game.ServerStorage:GetDescendants()
local names = { }

for _, descendant in ipairs(descendants) do
    if descendant:IsA("Tool") then
        table.insert(names, descendant.Name)
    end
end

return names

Yeah I also tried using that code in the server except it doesn’t insert the name to the table, it inserts the object to the table. I’ll try that instead and see what happens.

EDIT: It worked. Thanks for the quick response!