local giver = script.Parent.Giver local weapon = script.WeaponName local function onGiverTouched(gamer) local earf = game.Players:FindFirstChild(gamer.Name) if earf.Backpack:FindFirstChild(weapon.Value) then else local clone = game.ReplicatedStorage:FindFirstChild(weapon.Value) clone:Clone() clone.Parent=game.Players:FindFirstChild(gamer.Name).Backpack end end giver.Touched:Connect(onGiverTouched)
Im trying to create a simple gravity coil giver
Here's the error:Workspace.GravityCoilGiver.GiverScript:7: attempt to index nil with 'Backpack'
The "Touched" event provides the part that touched the giver, not the player that contains it. Your script is attempting to find a player with the same name as said body part, which results in nil.
Simply replace gamer.Name
on lines 5 and 11 with gamer.Parent.Name
so the script can get the actual player name and find the backpack.