|
| 24 Jun 2015 05:56 PM |
I am trying to find a part of a username, and if part of that username is found it will print my username.
But for some reason I have to put the full name in order for this to work. I want it so that all I have to put is "Dj" and it will find the full username.
Is there a way to do this?
Code:
local players = game.Players:GetPlayers() for i=1, #players do if string.match("Dj", players[i].Name) then print("Found Djmann1013!") end end
|
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 24 Jun 2015 05:57 PM |
| So you want anyone with the first 2 letters named Dj to pass through? |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2015 05:58 PM |
for _,player in pairs(game.Players:GetPlayers()) do if player.Name:find("Dj") then print("Found Djmann1013!") end end |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2015 06:14 PM |
| Thanks clonetrooper it works! |
|
|
| Report Abuse |
|
|