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

Can Someone point me in the right direction?!

Asked by 10 years ago

I'm a beginner scripter and This will probably be really easy to allot of you buy.. I was wondering if someone could point me in the right direction to get every player in games torso....

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
10 years ago

This is mostly done via a "for" loop, This loop goes trough every object you assign it to. In this case, we want to check trough all players, and get their torso.

Players = game.Players:GetChildren()

for i=1,#Players do
if Players[i] ~= nil then
    if Players[i].Character ~= nil then
        if Players[i].Character:FindFirstChild("Torso") then

            Players[i].Torso -- DO SOMETHING WITH THE TORSO'S HERE.

        end
    end
end

I hope this helps you out. If you have any other questions, Comment on this awnser or send me a pm. at Roblox.com User: Rubenk11

Ad

Answer this question