Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

"StarterGui is not a valid member of Player" ??!?!?!?

Asked by 8 years ago

Basically tried to make an energy bar.

script.Parent.Parent.Energy.Text = script.Parent.Parent.Energy.Integer.Value

Text is always equal to Integer Value..

  local Energy = script.Parent.Parent.StarterGui.StatsGui.Frame.Energy.Integer
    Energy = Energy -1

So when a player uses the magic, the Integer will -1 one but i get error :(

23:12:23.086 - StarterGui is not a valid member of Player
23:12:23.087 - Script 'Players.Player.Backpack.WizardStaff', Line 73
23:12:23.087 - Stack End

Sos :(!

2 answers

Log in to vote
1
Answered by 8 years ago

Players use PlayerGui

Just as the error says, StarterGui is not a member of Player - PlayerGui is. When a Player respawns, the StarterGui is typically cloned over into the PlayerGui.

Ad
Log in to vote
0
Answered by
Scootakip 299 Moderation Voter
8 years ago

StarterGui isn't copied over to Player, only the contents of StarterGui.

local Energy = script.Parent.Parent.StatsGui.Frame.Energy.Integer

Something like that should fix it. Basically just remember that StarterGui is not copied over, so it's never part of the Player

script.Parent.Parent.Energy.Text = ""..script.Parent.Parent.Energy.Integer.Value..""

Text needs a string value, but I'm guessing that Integer has an Int value. We need to put the Int value inside of a String value to get it working properly. That should fix it

0
OK, so it worked but the text does not change, any soloutions? LightModed 81 — 8y
0
I edited my answer to add and issue for the text not changing. That should have it working. Also, remember that if it works, make my answer and good so we both get credit Scootakip 299 — 8y

Answer this question