First the question: Can a local script not find for example a folder in ServerStorage? Second the error is attempt to index nil with FindFirstChild
script:
local player = game.Players.LocalPlayer
local backpack = player.Backpack
local tool = game.GetService:(“ServerStorage”):FindFirstChild:(“Computers”):FindFirstChild:(“Slow Computer”)
local c = tool:clone()
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
script.Parent.Parent.Unequip.Visible = true
backpack:FindFirstChildWhichIsA(“Tool”):Destroy()
task.wait(1)
c.Parent = backpack
this grabs the tool from the computer folder, deletes the current item in backpack and replaces it with the selected tool. Any help is highly appreciated.
ServerStorage does not replicate to the client, only the server can access ServerStorage.
You could use ReplicatedStorage which the client and server both can access.
a local script can’t access ServerScriptService and ServerStorage.
the error says you’re trying to call FindFirstChild from nil. it could be because it’s a local script so local tool = game.GetService:(“ServerStorage”):FindFirstChild:(“Computers”) will return nil.
Everything that you see on the explorer while playtesting on the client side is accessible through your local scripts. You can see that ServerStorage and ServerScriptService become empty, which is why you can’t access them from a local script.
Hiya, also I noticed that when you did the ‘MouseButton1Click’ that part you forgot that you need to end the statement by doing
local player = game.Players.LocalPlayer
local backpack = player.Backpack
local tool = game.GetService:(“ServerStorage”):FindFirstChild:(“Computers”):FindFirstChild:(“Slow Computer”)
local c = tool:clone()
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
script.Parent.Parent.Unequip.Visible = true
backpack:FindFirstChildWhichIsA(“Tool”):Destroy()
task.wait(1)
c.Parent = backpack
end)