I guess. And I’ve seen a few people making others use :GetPlayerFromCharacter instead. It’s weird how 3 lines work the same huh. Kind of like how people complain that you can do a lot of different things with the same outcome in c++ but way easier.
There are a few edge cases which are why you shouldn’t ever use the first one:
1- In a case where there is a non-Player child of the players service that shares a name with a real player/character, you wouldn’t want to use the first one as you can’t guarantee that players:FindFirstChild(string) returns a player unless you specify that the returnedValue:IsA(‘Player’). Even in that case, though, you would have to iterate through the player service’s children to find a corresponding player. At that point, you might as well use players:GetPlayerFromCharacter.
2- Similarly to case 1, if you have a part as a descendant of the workspace whose parent shares a name with a player, and that part is passed as otherPart to the touched event, it would return the real player.
So, players:GetPlayerFromCharacter() ensures that:
1- The character belongs to a player, and
2- A player object or nil is returned
Hey, I’m not familiar with the new display name thing. Does the Player take the name of the display name (i.e cody) and in that case couldn’t that cause issues as well, if two users with the same display name join the game? That would be another strong case for option 2