So I have this normal script:
script.Parent.Triggered:Connect(function(player) local tool = script.Parent.Parent.Parent.Parent.BoxTool:Clone() local path = game.Players:FindFirstChild(player) tool.Parent = path.Backpack print(player) end)
This script prints the player correctly. the path variable is fine. But whenever I try to access Backpack, it says attempt to index nil with Backpack. I tried this with FindFirstChild() and WaitForChild(), but it would say attempt to index nil with FindFirstChild() or WaitForChild depending on what I wrote.
FindFirstChild and WaitForChild expect a string, which is the name that it's looking for, but the player is an instance. It might work if you passed in player.Name into FindFirstChild.
However, this is redundant anyways because Roblox already passes in the player who triggered the prompt into the function (that's why you have "player" as an argument in the function instead of just empty parentheses.) Just do:
tool.Parent = player.Backpack