so it keeps giving me a error saying: attempt to index nil with 'Players' How Do I Fix It? here is The Code
--Variables--
local client = game.Players.LocalPlayer
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")--gets ReplicatedStorage
local ServerStorage = game:GetService("ServerStorage")--get ServerStorage
local ToolsFolder = ReplicatedStorage:FindFirstChild("Tools")-- gets the tools folder
local InventoriesFolder = ServerStorage:FindFirstChild("Inventories")-- gets the inventories folder
local button = script.Parent-- gets the button
local SpeedCoil = ToolsFolder:FindFirstChild("SpeedCoil")
print("VariablesDone!")--prints "VariablesDone!"
--MainScript--
button.MouseButton1Click:Connect(function()--when a player presses the button in left click
print("Pressed")-- when a player presses the button then it will print out "Pressed"
local inventory_folder = InventoriesFolder[client.Name]
print("No Errror BRUH")
SpeedCoil:Clone().Parent = inventory_folder
print("No Errror BRUH2")
SpeedCoil:Clone().Parent = client.Backpack
print("No Errror BRUH3")
SpeedCoil:Clone().Parent = client.StarterGear
print("No Errror BRUH4")
end)
Thanks!! (Someone Solved It So Local Scripts Cant Acess ServerStorage So Yea TYSM To That Guy/Girl I Forgot Hers/His Name)

9 comments
Does it provide a line number?
From this code, it seems you are not indexing anything from Players so I am not sure this is the snippet of code you should be showing.
Sparks Indeed Its At Line
14
Sparks Idk What You Mean.Sorry Im Just New, Please Explain It Better.Im Really Really Sorry
can u tell what is script.parent.parent.parent etc u can directly index it with game.Workspace etc
Ohhhhh yea , im sorry i got the wrong variable But Its Supposed To Be "game.Players.LocalPlayer" Im Really Sorry I Copied The Wrong Variable Im Rlly Sorry
I Saved The Edits ThankYou, Now It Still Does Not Work Even Though It Already Syas"game.Players.LocalPlayer"
Sparks it Still does Not work I Changed It To "local client = game.Players.LocalPlayer" And Gave Me A new Error Saying " : attempt to index nil with 'Rgboffical_yt' " Please Help ThankYou!!