Hi, I'm making tool which checking inventory for tool and I'm doing something bad but I don't know what. Anyone know what's wrong?
local player = game:GetService("Players").Backpack
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
if player.Backpack:FindFirstChild("Tool name goes here") then
print("Tool exists")
end
end
end)

2 comments
You should explain what you're doing.
Explanation: Your line 1 was wrong, i can't explain it why it was just very very wrong, you can not do that, to get the player backpack in a server script you need to use line 3 that i made which in brackets there is your character, and :GetPlayerFromCharacter is function that gets the player from character, i did not change anything except that line. Hope you understood.