while wait() do
local players = game.Players:GetChildren()
for _,p in pairs(players) do
print(p)
if workspace:FindFirstChild(p) ~= nil then
print("1")
end
end
end
edit: my fix is to change the code to get the same results but I still don't understand why the first code doesn't work.
while wait() do
for _,player in pairs(game.Players:GetChildren()) do
if player.Character:FindFirstChild("Humanoid") ~= nil and player.Character ~= nil then
local torso = player.Character:FindFirstChild("UpperTorso")
local human = player.Character:FindFirstChild("Humanoid")
print(torso.Position)
end
end
end

3 comments
format pls
also if i deal with ur question in all technicality, players dont exist in the workspace, their characters do. if u want to find the players u go to game.Players; if u want to find their characters the easiest way would be to scan the workspace for an object matching the player's name, cus if u didnt know the character model's name is named after the player controlling it.
FindFirstChild takes a string of the name, you already have the player instance, but use GetPlayers instead. Then you just need to do player.Character.