Can't Get Child of ServerStorage

I am trying to make a house picker script but I can’t get a child of ServerStorage. I have a workaround, but that is to put the models in the Workspace and that will cause unnecessary lag.
Script:

local Event = game.ReplicatedStorage.HouseSelectEvent
local Houses = game.ServerStorage:WaitForChild("Houses")
local C = Houses:GetChildren()
local Sign = game.Workspace.HomeSign
local Players = game:GetService("Players")
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420

function SpawnHouse(Player, House, Plot)
	for i = 1,#C do
		if C[i].Name == House then
			local userId = tonumber(Player.UserId)
			local clone = C[i]:Clone()
			clone.Parent = Plot
			clone:MakeJoints()
			clone.Door.SurfaceGui.Owner.Text = Player.Name
			local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
			Plot:FindFirstChildWhichIsA("Model").WindowBody.Window.SurfaceGui.ImageLabel.Image = content
			clone:SetPrimaryPartCFrame(Plot.CFrame)
		else
			continue
		end
	end
end

Event.OnServerEvent:Connect(function(Player, House, PlotNum)
	local OwnsHouse = Player:FindFirstChild("OwnsHouse")
	local HouseOwned = Player:FindFirstChild("HouseOwned")
	Plot = game.Workspace:FindFirstChild("Plot "..PlotNum)
	Owner = Plot.Owner
	if HouseOwned.Value == "" and (Owner.Value == Player.Name or Owner.Value == "") then
		Owner.Value = Player.Name
		OwnsHouse.Value = true
		HouseOwned.Value = Plot.Name
		if Plot:FindFirstChild("HomeSign") then
			Plot:FindFirstChild("HomeSign"):Destroy()
		end
		if Plot:FindFirstChildWhichIsA("Model") then
			Plot:FindFirstChildWhichIsA("Model"):Destroy()
		end
		SpawnHouse(Player, House, Plot)
	end
end)

Players.PlayerRemoving:Connect(function(Plr)
	if Owner and Owner.Value ~= "" and Plot then
		if Owner.Value == Plr.Name then
			Plot:FindFirstChildWhichIsA("Model"):Destroy()
			Owner.Value = ""
			local clone = Sign:Clone()
			clone.Parent = Plot
			clone:MakeJoints()
			clone:SetPrimaryPartCFrame(Plot.CFrame)
		end
	end
end)

It keeps saying infinite yield on the second line.

Explorer:
image

Why not just do:
local Houses = game.ServerStorage.Houses

It says “Houses is not a valid member of ServerStorage “ServerStorage””

Have you made sure that the names match? Try copying the name of the folder to the string.

If this is inside a LocalScript, you can’t access the ServerStorage that way since you can only get the ServerStorage on the server-side

If it is in this instace:

Change it to a Server Script plz

I didn’t change the name at all, I just changed the parent of the Houses folder and now it doesn’t work.

Its in a server script, not a local script.

Ensure that there isn’t an extra space at the end of the name – this is something that happened in another topic I responded to when something wasn’t able to be found.

Since it appears that you’re trying to access it via a ModuleScript or Server Script (since you have an OnServerEvent function), and if the folder is already there before runtime, I don’t see another reason why it wouldn’t be able to find it.

There isn’t any extra space, all I did was change the parent.

Do a quick test in studio → while in the test, switch to server view and verify that the contents in ServerStorage actually exist. Screenshot what you see in the test.

Also can you screenshot where the script is located?

I can’t see the children of ServerStorage when testing.

Are you viewing it on the the server or client side?

You can switch views here:

I was on client, but the contents actually exist and the script is inside of ServerScriptService.

From the server view can you verify that you don’t have any other items called “ServerStorage” and that the “Houses” folder exist.

Alternatively, you could also try:

local Houses = game:GetService("ServerStorage"):WaitForChild("Houses")

I know you heard this quite a bit, but are you 100% sure that you aren’t calling it from a local script? or having a local script require a module to do this, etc.

Also, could you screenshot the warning/error?

I am 100% sure that it is a server script.

Okay, so I moved the folder to ReplicatedStorage and now it’s working. I’m still wondering why it won’t let me use ServerStorage.

try with :FindFirstChildWhichIsA(“Folder”) if it’s the only folder in SS, if that doesn’t work then it’s acting like you don’t have access to SS for sure

Can you like physically show me where the script is? And are you sure its the script you posted above that’s causing the infinite yield?

Like just screenshot the actual error, the scripts location, and the scripts contents.

I’m like 99% sure that your actually trying to reference contents within serverstorage from the client.

I fixed it, I just moved the folder to ReplicatedStorage.