Cloning a tool from server Storage

I’m wanting to clone a tool from serverstorage and parent it to the player backpack. The problem is, when I press the button GUI that has a local script, the output says
Wood is not a valid member of ServerStorage "ServerStorage" - Client - BuyScript:11
My script:

local Player = game.Players.LocalPlayer
local button = script.Parent
local SS = game:GetService("ServerStorage")

button.MouseButton1Click:Connect(function()
	local backpack = Player:WaitForChild("Backpack")
	if backpack then
		print("Found Player Backpack")
		local woodCheck = backpack:FindFirstChild("Wood")
		 if woodCheck then
			local stoneClone = SS.Stone:Clone()
			stoneClone.Parent = backpack
			print("Found Wood and gave stone")
		 else
			print("No wood")
		 end
	end
end)

Any ideas?

Client cannot access serverstorage last time I checked, move the tool to lighting, or replicated storage.

2 Likes

Move it to ReplicatedStorage (please do NOT put it in Lighting)

1 Like

uhhhhh i wanna ask why not to, but I also dont

Simply to keep your game organised. It doesn’t make sense to put a tool in Lighting, although it will technically work the same

1 Like

Server storage contents cannot be accessed from the client. You also shouldnt get tools from the client because they won’t replicate (“exist”) on the server, and you would run into errors when indexing the tool. Better use a RemoteEvent to do the tool adding job, but you’ll have to add some checks for security

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.