I am trying to make a passport/security system. This script is when the person equips the passport and put the passport on the touch part, the tool name is the player’s name. I am trying to get everything in the player’s backpack so I tested using the loop script, the problem is it didn’t print “a”.
script.Parent.Touched:Connect(function(hit)
if hit.Parent.ClassName == "Tool" then
if game.Players:FindFirstChild(hit.Parent.Name) then
local player = game.Players:WaitForChild(hit.Parent.Name)
script.Parent.Parent.Parent.Screen.SurfaceGui.Texts.Name2.Text = "Name: "..player.Name
script.Parent.Parent.Parent.Screen.SurfaceGui.Texts.AccountAge.Text = "Account Age: "..player.AccountAge.. " days"
for i,v in pairs(game.Players:WaitForChild(hit.Parent.Name).Backpack:GetChildren()) do
print("a")
end
end
end
end)