I've tried altering a giver to instead ClearAllChildren from the player's backpack, and I've tried this recent code:
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
script.parent.Touched:connect(function(hit)--Touched event
humanoid=hit.Parent:FindFirstChild("Humanoid")--Finding the Humanoid
if humanoid ~=nil then--If the humanoid exists
local player = getPlayer(humanoid)
if (player == nil) then return end
player.Backpack:ClearAllChildren()--ClearsPlayerInventory
end
end)
But even through many different kinds of articles and such about things similar to this, I can't figure it out. Any help? Thanks.

1 comment
You're over thinking this A LOT.