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 |
|
|
| |
|
Rivalize
|
  |
| Joined: 01 Mar 2013 |
| Total Posts: 5826 |
|
|
| 12 Mar 2013 12:43 PM |
| Oh yeah, forgot about that method, thanks. |
|
|
| Report Abuse |
|
|
Rivalize
|
  |
| Joined: 01 Mar 2013 |
| Total Posts: 5826 |
|
|
| 12 Mar 2013 12:44 PM |
Another question: How would I input that? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 01 Mar 2013 |
| Total Posts: 5826 |
|
|
| 12 Mar 2013 12:59 PM |
| Agh, can someone edit that script for me? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 01 Mar 2013 |
| Total Posts: 5826 |
|
| |
|