I received help on this problem earlier and it helped sort of. Here is the code and error:
game.Players.PlayerAdded:Connect(function(plr)
local plrFolder = Instance.new("Folder", game.ServerStorage)
plrFolder.Name = plr.Name
local plrInfo = Instance.new("Folder", plrFolder)
plrInfo.Name = "PlayerInfo"
end)
-- in another script
local plrName = plr.Name
local plrInfo = game.ServerStorage:FindFirstChild(plrName):WaitForChild("PlayerInfo") -- this is what is erroring and I have no idea why, because it works in the playerremoving script. please help me understand what is going wrong.
-- the error is: "ServerScriptService.BoxDroppingScript:36: attempt to index a nil value"
Please help

1 comment
Give us the entire script please.