Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to search the whole server for a player with a certain tool in his backpack?

Asked by 4 years ago

how to search the whole server for a player with a certain tool in his backpack? because the tool can be only with one player

like i want to search the whole server for that player and if that tool is in his backpack, then want to make that player a variable

1 answer

Log in to vote
0
Answered by
hallmk7 50
4 years ago
local players = game.Players:GetChildren()

for _, player in pairs (players) do
if player.Backpack:FindFirstChild("Tool") then
local PlayerWhichIsNeeded =  player
end
end

this might help you out but just see the capitals and all...

thanks!!

Ad

Answer this question