Davillion
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 853 |
|
|
| 14 Apr 2013 10:58 AM |
I think my brain must be blanking out, because for some reason I cannot get this to only look for v.Name after the third character in str. How can I make this (on line 5) look only after the third character? Thanks for the help.
function matchplayer(str) local result = nil local players = Game.Players:GetPlayers() for i,v in pairs(Game.Players:GetPlayers()) do if (string.find(string.lower(v.Name), str) == 1) then if (result ~= nil) then return nil end result = v end end return result end |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 11:10 AM |
if (string.find(string.lower(str,3)) == v.name
-- I think that's it xD
~ Make the simple, amazing ~ |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 11:11 AM |
I don't really know what you are trying to do.
~ Make the simple, amazing ~ |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 11:12 AM |
Whoops:
if (string.find(string.lower(v.Name), (str,3)) == 1) then
-- That will only get the str after 3rd character... If that's what you want. ~ Make the simple, amazing ~ |
|
|
| Report Abuse |
|
|
Davillion
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 853 |
|
|
| 14 Apr 2013 09:45 PM |
| Ah, that's perfect, thanks. I kept doing something similar to what you were doing. |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 09:48 PM |
Glad to help :)
~ Make the simple, amazing ~ |
|
|
| Report Abuse |
|
|
Davillion
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 853 |
|
|
| 14 Apr 2013 09:49 PM |
| And also, it does not work o.e |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 09:51 PM |
XP i suck.. Im on mobile so there is nothing i can do. But you can PM me what you are trying to do and I will reply to you tomorrow :)
~ Make the simple, amazig ~ |
|
|
| Report Abuse |
|
|