Advertisement
DrawingJhon

GetPlayer for characters

Jun 1st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. function getPlayer(shortcut)
  2. local player = nil
  3. local g = game.Players:GetPlayers()
  4. for i = 1, #g do
  5. if string.lower(string.sub(g[i].Name, 1, string.len(shortcut))) == string.lower(shortcut) then
  6. player = g[i]
  7. break
  8. end
  9. end
  10. return player
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement