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

Anchor all players?

Asked by 9 years ago

I've seen in games anchor all players I've been trying to figure out how to anchor all players?

1 answer

Log in to vote
0
Answered by
funyun 958 Moderation Voter
9 years ago
function AnchorPlayers()
    local players = game.Players:GetPlayers()

    for _, v in pairs(players) do
        if v.Character then v.Character.Torso.Anchored = true end
    end
end

AnchorPlayers()

So, we start a function called AnchorPlayers. Then we make a variable that stores a table of the players. We then go through that table of players and check if each player has a character model. If they do, anchor the torsos. Then we just end all the scopes and call the function.

1
Thank you :) DiamondCookie2 0 — 9y
Ad

Answer this question