I have some code that assigns a tool from serverstorage to the player’s backpack. Here is the script in serverscriptservice:
game.ReplicatedStorage.GiveTool.OnServerEvent:Connect(function(player)
local toolToGive = game.ServerStorage.Antibody
local toolClone = toolToGive:Clone()
toolClone.Parent = player.Backpack -- this is the problem
end)
Upon examining the debugger’s watch and call stack I found something interesting: the tools’s parent is actually nil (see image below)
I find this weird as I assigned the tool’s Parent to the player’s Backpack, which clearly exists because I have seen some posts saying maybe the player’s backpack has not loaded yet. How do I fix this issue? FYI: I don’t want to use the player:CharacterAdded() method because the script is actually part of a remote event, so the client-side presses a button to equip a tool (which fires the remote event) and it gets cloned into the player’s backpack.