Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

Roblox Get player by name

local function getPlayerFromName(name)
   -- loop over all players:
   for _, player in pairs(game:GetService("Players"):GetPlayers()) do
      -- if their name matches (case insensitive), return with that player:
      if player.Name:lower() == name:lower() then
          return player
      end
   end
   -- if we reach the end of the for-loop, no player with that name was found
end
Source by devforum.roblox.com #
 
PREVIOUS NEXT
Tagged: #Roblox #Get #player
ADD COMMENT
Topic
Name
8+3 =