game.ReplicatedStorage.Farming.SeedFinder.OnClientEvent:Connect(function()
warn("Recieved Call")
for i,v in pairs(game.Players.LocalPlayer.PlayerGui.ScreenGUI.Inventory.Slots:GetChildren()) do
if v.ItemName.Value == game.ServerStorage.Values.SelectedSeed.Value.." Seeds" then--This line is the one causing the error
warn("Found Seed and now doing stuff with it")
v.Count -= 1
script.Parent.Plant:FireServer()
break
end
end
end)
The line giving the error says that Values is not a valid member of ServerStorage “ServerStorage”. That folder does in fact exist however, and I have checked both while the game is running and when it’s not. I tried :WaitForChild(), but that game me an infinite yield message, and :FindFirstChild() gave me a separate error saying that the SelectedSeed value was nil. What is wrong here and how can I fix it?
As @JarodOfOrbiter said: you cannot access ServerStorage on the client.
ReplicatedStorage should be used instead since like @JarodOfOrbiter also said, it is accessible to both the server and client, meaning the client and server can view and access everything inside of it.