✓ Accepted answer
Three things.
1. You can get the head of every player by simply looping through the player list using a for loop. When doing this however, make sure to check for their characters, as well as their heads, as if a player had died, or even had his head removed, it can cause an error when attempting to get the player's head. Here's a quick example.
for i,v in pairs(game.Players:GetChildren()) do
if v.Character and v.Character:FindFirstChild("Head") then
v:Destroy()
end
2. From your request, I'm assuming that getting the heads of every player is how you plan on accomplishing the goal of getting nicknames. Currently, I'm under the assumption that one would set their nickname based on the input from a gui object, such as a text box. Now, I'm certain one can use a loop like the one above to accomplish the task, but I would personally suggest simply using a remote function or remote event(based on the nature of the request, I'm also assuming a remote event would be used) to add a billboard gui or just set the text of it to the proposed name.
3. Just a friendly reminder that since these are nicknames, players can very well put some "no no words" as their nicknames, which may result in Roblox putting the game you're making under review. If you plan on using nicknames in your game, make sure to add text filtering to the game in order to ensure this doesn't happen to you.
1 comment
-1. Remove() is deprecated