|
| 12 Sep 2017 09:01 PM |
playerList = game.Players:GetChildren() for i,player in pairs(playerList) do print(player) local experience = Players[player].leaderstats.Experience.Value print(player) local level = Players[player].leaderstats.Level.Value if experience > 50 + (50 * level) then level = level + 1 end wait(1/12) end
When ever I try to run this code the for loop doesn't execute, I know this as the print(player) doesnt print anything. Any help is always appreciated. |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 12 Sep 2017 09:11 PM |
if your running that code right when the server starts up, chances are the script ran first before the players actually had time to join the game.
or
You could have a waitforchild() delaying the thread
you should also replace :GetChildren() with :GetPlayers()
Need Help With scripting or Hire Scripters? Go here! via Discord : rfnudw6 |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2017 09:13 PM |
| Im delaying it by 45 seconds, but I will try the GetPlayers() instead, thank you :) |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2017 09:37 PM |
player.Name
player is an object so you want to get the name
lua_getfield(lua_State, -1, "MemeService") |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 12 Sep 2017 09:42 PM |
| If nothing is being printed then neither changing it to GetPlayers nor using player.Name would fix anything. Since it looks right (enough to at least print the name of the first object in Players) I would say the problem is pretty certainly elsewhere in the script. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2017 09:55 PM |
Boeing you're back!!!!
"player is an object so you want to get the name" tostring on a Roblox Instance returns instance.Name, and print calls tostring. Ergo, not a requirement.
|
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 12 Sep 2017 11:12 PM |
| I have been on for a while but usually I am on one of my tens of alts or I lose motivation midway through writing the reply because of how few interesting posts there are now... |
|
|
| Report Abuse |
|
|