✓ Accepted answer
There are a few things wrong with this code. First of all, "players" does not exist. It's "Players". As a matter of fact, it is recommended to use :GetService as well. Also, use local variables (For example: "local x = 5"). You also cannot load the character of the Players service, as it is not an actual player instance. To combat this, you should loop through all of the player's in Players by using a for loop. However, you can only loop through tables, so you should use :GetPlayers as it returns a table. In a scenario in which you aren't looping through the players in Players or the players in a team, you would use :GetChildren instead, as it also returns a table.
Here is the final product:
local players = game:GetService("Players")
while true do
wait(60)
for _, player in pairs(players:GetPlayers()) do
player:LoadCharacter()
end
end
3 comments
Using
:GetService()is really not necessary unless you are writing code for the client. Outside of the client, it is not recommended to use one over the other; it's up to user preference. Client-side code should use:GetService()because a hacker can rename services to whatever they like, and in the process cause badly written scripts to error.Secondly,
forloops aren't restricted to looping through tables.Alright, my mistake. Thanks for the information.