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 » Scripters
Home Search
 

Re: Search Bar

Previous Thread :: Next Thread 
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
16 Jun 2015 10:19 PM
How do I make a search bear where you don't have to type in the player's full name, just part of it, and it's able to find the player?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
16 Jun 2015 10:22 PM
string.gmatch("%*^#") something like that
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
16 Jun 2015 10:22 PM
Bears can't read, so what your attempting to describe is impossible.

String concatenation.
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
16 Jun 2015 10:22 PM
*String patterns
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
16 Jun 2015 10:23 PM
Thanks guys!
Report Abuse
GeoVolcano is not online. GeoVolcano
Joined: 05 Jul 2012
Total Posts: 1433
16 Jun 2015 10:24 PM
Here's your list:

http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#string.len
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Jun 2015 10:24 PM
'%*^#'
wtf what...

OP all players in-game? You can just use a loop and string.sub and the # operator.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
16 Jun 2015 10:32 PM
Hmm...

for i, v in pairs(workspace:GetChildren()) do
for x in string.gmatch(v.Name, "Ba") do
print(v, x)
end
end

How do I make it print if anything in the workspace starts with "Ba"
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Jun 2015 10:35 PM
Do you want to start from the beginning of the string or from any part?
Like: "cnt" gets cntkillme, will "kill" get cntkillme?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
16 Jun 2015 10:38 PM
found this off of vote kick script. You could do something similar

function matchPlayer(str)
local result = nil
local players = game.Players:GetPlayers()
for i = 1,#players do
if (string.find(string.lower(players[i].Name), str) == 1) then
if (result ~= nil) then return nil end
result = players[i]
end
end
return result
end

function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (string.find(msg, "kick") == 1) then
for word in msg:gmatch("%w+") do
if word ~= "kick" then
local p = matchPlayer(word)
if p ~= nil then
voteAgainst(source, p)
end
end
end
end
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Jun 2015 10:39 PM
That's such a bad kick script.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
16 Jun 2015 10:43 PM
Thanks!

for i, v in pairs (workspace:GetChildren()) do
if (string.find(v.Name, "Ba") == 1) then
print(v.Name)
end
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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