Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

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

2 comments

0

OK, so it worked but the text does not change, any soloutions?

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

This discussion is preserved as it was. New answers, comments, and votes are closed.