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
 

Re: Methods to detect lowercase names?

Previous Thread :: Next Thread 
Rivalize is not online. Rivalize
Joined: 01 Mar 2013
Total Posts: 5826
12 Mar 2013 12:42 PM
script.Parent.playerinfo.tell.Text = "Loading MP/NP..."
wait(4)
if game.Lighting["Data Cluster"]:FindFirstChild(player.Name) then
script.Parent.playerinfo.tell.Text = "Your MP: " .. game.Lighting["Data Cluster"].player.Name.MP.Value .. ", Your NP: " .. game.Lighting["Data Cluster"].player.Name.NP.Value
else
script.Parent.playerinfo.tell.Text = "Failed!"
end

^^

In that script, it executes "player.Name," but the thing in Lighting in lowercase, while the player's name is uppercase. What is a way to lowercase the player's name and then search for it in Lighting?

(And would there be a way to fix:
(RIVALIZE
"rivalize")

Cause it won't go through, it has to be exact.
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
12 Mar 2013 12:43 PM
string.lower()
Report Abuse
Rivalize is not online. Rivalize
Joined: 01 Mar 2013
Total Posts: 5826
12 Mar 2013 12:43 PM
Oh yeah, forgot about that method, thanks.
Report Abuse
Rivalize is not online. Rivalize
Joined: 01 Mar 2013
Total Posts: 5826
12 Mar 2013 12:44 PM
Another question:
How would I input that?
Report Abuse
einsteinK is not online. einsteinK
Joined: 22 May 2011
Total Posts: 1015
12 Mar 2013 12:48 PM
function findChild(name)
for k,v in pairs(game.Lighting:GetChildren()) do
if v.Name:lower() == name:lower() then
return v
end
end
end

print(findChild(player.Name)) -- Example "einsteinK"
-- Will return "einsteink" in Lighting, or when weird things happens anything like:
-- "EinsteinK","einsteinK","EiNsTeInK", ...
Report Abuse
Rivalize is not online. Rivalize
Joined: 01 Mar 2013
Total Posts: 5826
12 Mar 2013 12:59 PM
Agh, can someone edit that script for me?
Report Abuse
einsteinK is not online. einsteinK
Joined: 22 May 2011
Total Posts: 1015
12 Mar 2013 01:03 PM
local function getPlayer(p)
for k,v in pairs(Game.Lighting["Data Cluster"]:GetChildren()) do
if v.Name:lower() == p.Name:lower() then
return v
end
end
end

script.Parent.playerinfo.tell.Text = "Loading MP/NP..."
wait(4)
if getPlayer(player) then
local data = getPlayer(player)
script.Parent.playerinfo.tell.Text = "Your MP: " .. data.MP.Value .. ", Your NP: " .. data.NP.Value
else
script.Parent.playerinfo.tell.Text = "Failed!"
end
Report Abuse
Rivalize is not online. Rivalize
Joined: 01 Mar 2013
Total Posts: 5826
12 Mar 2013 01:08 PM
Thanks.
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