|
| 12 Aug 2013 01:12 PM |
Before you ask, yes, this is in a LocalScript. Here's the line of code where the error lies:
if game.Players.LocalPlayer.leaderstats.Lvl.Value <= 5 then
And the output: 20:06:48.362 - leaderstats is not a valid member of PlayerGui 20:06:48.364 - Script "Players.Player1.PlayerGui.ObjectiveGUI.Objectives.LocalScript", Line 5 20:06:48.364 - stack end
Tested using Test-> Start Server-> Start Player and also by saving the game and clicking "Play" as normal...
What am I doing wrong? Any help is appreciated. Thanks. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2013 01:20 PM |
game.Players.LocalPlayer shouldn't be of type PlayerGui....
I'm calling shenanigans |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 01:24 PM |
I think your ROBLOX may be broken... Never will game.Players.LocalPlayer become a member/type of PlayerGui
Possibru. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 01:27 PM |
| Well that's why I'd need some help, I don't understand this either ._. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 01:29 PM |
I also tried using a normal script and doing script.Parent.Parent.Parent.Parent instead. Same result.
God this is confusing ._. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 02:01 PM |
I made a model of the whole GUI that this script is in. If you fix it or if it works for you you can have it. (free st00f ermahgerd)
If anyone could try the model out and see if you get the same error that would be helpful: http://www.roblox.com/ObjectiveGUI-item?id=126222800
You will also need a leaderboard for the whole script to work, but to just see this error you shouldn't need it... |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2013 02:10 PM |
That's not line 5, the one that you think is line 5.
That's line 3. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 02:13 PM |
I altered the script a tiny bit before making it into a model. Didn't change the output on my part though :/ (Except for the Line part) Sorry for any confusion. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2013 02:25 PM |
Because you are doing it wrong
game.Players.LocalPlayer.leaderstats, not script.Parent.Parent.leaderstats or whatever you have |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 02:39 PM |
game.Players.LocalPlayer.leaderstats is exactly what I have right now... I tried script.Parent.Parent.Parent.leaderstats also, but that gave exactly the same error. :S |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 02:58 PM |
| Has anyone tried the model...? |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 12 Aug 2013 03:07 PM |
Blocco is correct. You gave us the incorrect line.
"sp = script.Parent.Parent" -> ObjectiveGUI "sp.Objective.Settings.CurrentAmount.Value = sp.Parent.leaderstats.Lvl.Value"
You're attempting to find 'leaderstats' in the player's PlayerGui, hence your error. This was pointed out by Blocco.
|
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 03:14 PM |
My bad, I got line 3 confused with line 5 since what is now line 3 used to be line 5... (should have seen it since it's obvious with the output...)
Anyway, thanks for the help and sticking around helping me even though it was just me being confused after all! Appreciate it :) |
|
|
| Report Abuse |
|
|