What can be another name for the function "GetPlayerFromCharacter"? I believe that it can be another name for the word "in". For Example:
if game.Players:GetPlayerFromCharacter(Part.Parent) ~= nil then
What I see in this in words is: If the Player in Part.Parent(Which in this case is Workspace) exists(Not Nil), then...
Is this correct or am I seeing something wrong? Let me know. Thanks.
Your reading of "the player in model
" explains the purpose of GetPlayerFromCharacter
, however, I don't think it is nearly as precise or technically accurate as could be. Here's a more precise way to read it:
I would read
game.Players:GetPlayerFromCharacter(model)
as
the player whose character is
model
The line you supplied could then be read as
If there is a player whose character is (
Part
's parent) (the "player" is notnil
) then
A shorter way to read the purpose of this line though would be:
If (
Part
's parent) is a player's character then
As a side note, note that the ~= nil
is unnecessary. Just
if game.Players:GetPlayerFromCharacter(Part.Parent) then
Accomplishes the same; for if it is a Player, it will happen, if it is nil
, it will not.