generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

string.sub

Previous Thread :: Next Thread 
Davillion is not online. 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
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
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
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
14 Apr 2013 11:11 AM
I don't really know what you are trying to do.

~ Make the simple, amazing ~
Report Abuse
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
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 is not online. 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
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
14 Apr 2013 09:48 PM
Glad to help :)

~ Make the simple, amazing ~
Report Abuse
Davillion is not online. Davillion
Joined: 09 Dec 2008
Total Posts: 853
14 Apr 2013 09:49 PM
And also, it does not work o.e
Report Abuse
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image