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: Can you shorten this function?

Previous Thread :: Next Thread 
CUBES4LIFE is not online. CUBES4LIFE
Joined: 22 Jun 2009
Total Posts: 4956
18 Nov 2015 06:06 PM
function findPlayer(name)
for i, player in ipairs(game.Players:GetPlayers()) do
local plr = player.Name:sub(1,string.len(name))
local plyr = plr:lower()
if name:lower() == plyr then
return player
end
end
end
Report Abuse
CLIMAXIMUS is not online. CLIMAXIMUS
Joined: 22 Jun 2012
Total Posts: 1738
18 Nov 2015 06:11 PM
game.Players[PlayerName:lower()]
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Nov 2015 06:11 PM
local function findPlayer(name)
local players = game.Players:GetPlayers();
for key = 1, #players do
if players[key].Name:match(name) then
return players[key];
end
end
end
Report Abuse
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
18 Nov 2015 06:11 PM
here i shortened it very slightly!

function findPlayer(name)
for i, player in ipairs(game.Players:GetPlayers()) do
local plr = player.Name:sub(1,string.len(name)):lower()
if name:lower() == plr then
return player
end
end
end
Report Abuse
CLIMAXIMUS is not online. CLIMAXIMUS
Joined: 22 Jun 2012
Total Posts: 1738
18 Nov 2015 06:12 PM
i dont really understand what your function does
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
18 Nov 2015 06:23 PM
>game.Players[PlayerName:lower()]

kek
Report Abuse
CUBES4LIFE is not online. CUBES4LIFE
Joined: 22 Jun 2009
Total Posts: 4956
18 Nov 2015 06:47 PM
the script allows for a player to say like "!kill cu" and it would kill me, Cubes4Life.
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