I Need help Help With Using v Variable In Brackets?
Asked by
4 years ago Edited 4 years ago
Here is the part of the script where it is erroring, It is erroring on line 5.
3 | Players = game.Players:GetChildren() |
4 | for i, v in pairs (Players) do |
5 | if game.Players [ v ] .PlayerGUI.ScreenGui.SettingsGUI.InteractiveGUI.Settings.AfkModButton.Text = = "OFF" then |
6 | PlayersReady = PlayersReady + 1 |
So supposidly this would check if the selected player is afk or not and if they are not we will add players ready + 1, and we would do that for every character.
The question is while when I use the variable v in that case it does not work, and I dont know how I would detect the playername.