I'm thinking I would need to do something with GetChildren() but I'm not sure what. Any ideas?
COMMUNITY QUESTION
How would I make a script that checks if a player has things in their backpack?
1 answer
There is a handy way to do this. As you said, GetChildren() is a built-in Roblox function that solves problems like these.
Put this in a LocalScript that's under ReplicatedFirst
local backpack = game:GetService("Players").LocalPlayer:WaitForChild("Backpack")
for name, child in pairs(backpack:GetChildren()) do
if child:IsA("Tool") then
if child.Name == "YourNameHere" then -- Replace YourNameHere with the name of the tool you wanna find
print("Tool Found!")
end
end
end)
I hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
@2ndwann why in ReplicatedFirst? Also what even is replicated first
@Vursatile, in order for LocalScripts to work, they have to be in ReplicatedFirst or in a Tool. Maybe you should read this: https://developer.roblox.com/en-us/api-reference/class/LocalScript