I tried both, and it errored. Is there any way around this?
ReplicatedStorage does work in LocalScripts, as the contents are replicated in the client and server.
local repStorage = game.ReplicatedStorage:findFirstChild("WhateverName")
I've used it in my games.
However, ServerStorage cannot be accessed with LocalScripts, since it is only accessible by server. See here for more about that.
Using ServerStorage
should work from a LocalScript, I have used it in LocalScripts.
Was the error that you were referring to ServerStorage, or something else?
I still get the error (see OP) when I try to index Replicated Storage.
Here's my code:
for s in shopitems.Value:gmatch("%P+") do if inventory.Value:gmatch(s) then -- errors game.ReplicatedStorage(s):clone().Parent = player.Backpack end end
If it actually makes it to line 3, change the parenthesis to brackets on game.Replicatedstorage, and capitalize Clone:
game.ReplicatedStorage[s]:Clone().Parent = player.Backpack