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

How do we detect all the players's characters?

Asked by 3 years ago
Edited 3 years ago

so basically i want to detect everyone's character in the server and i dont know how. i would put a script but i legit dont know where to begin

1 answer

Log in to vote
1
Answered by
DemGame 271 Moderation Voter
3 years ago

To get every player's character inside of a server, I would search the workspace for the names of the children of game.Players. Here's an example snippet of code for you:

for i,v in pairs(game.Players:GetChildren()) do
    if workspace:FindFirstChild(v.Name) then
        local Character = workspace:FindFirstChild(v.Name)
        --do code here
    end
end
Ad

Answer this question