Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function findPlayer(name)
- -- Even without the full username and improper caps you can find a player.
- for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
- if player.Name:lower():sub(1, #name) == name then
- return player -- Return the targeted player.
- end
- end
- return nil -- Return nil if no player was found. This is only reached if the above was not met.
- end
- print(findPlayer("Sj")) --> sjr04Alt (if im in game)
Advertisement
Add Comment
Please, Sign In to add comment