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

Menu Is Not A valid Member Of Local script?

Asked by 4 years ago
Edited 4 years ago
01script["Menu"].Parent = game.Players.LocalPlayer.PlayerGui
02 
03--Locals
04local Players = game:GetService("Players")
05local StarterGui = game:GetService("StarterGui")
06 
07--GUI Reference
08Gui = game.StarterPlayer.StarterPlayerScripts.EnterGame.Menu
09 
10--Makes sure that the player doesn't spawn at the start.
11game.Players.CharacterAutoLoads = false
12 
13--When the player loads into the game, it shows the GUI
14game.Players.PlayerAdded:Connect(function(player)
15    for _, gui in pairs(StarterGui:GetChildren()) do
View all 28 lines...

Hello! I have been trying to add a menu to my game. The problem I originally had was that the main menu wouldn't show due to Character auto loads being off. I solved this by searching it up on the all mighty dev forums. But the next problem was the error in the title: Menu is not a valid member of LocalScript "Players.MyUserName.PlayerScripts.EnterGame" Anyone know where I made my mistake?

(Keep in mind I'm new)

Thanks.

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Due to lack of context, I can't understand exactly what you are trying to achieve with this script, but normally, you would'nt parent a GUI under a script. If you did, then please provide some more context, if you did not, then there's your problem. Simply parenting a GUI under StarterGui will automatically replicate to a player's PlayerGui.

0
nope I did this on purpose, the post I had read advised that was the way to do it. For clarity, I want to make a menu but not have people killed over and over while they are still in the menu. ThatsSad523 2 — 4y
0
By "that was the way to do it" I'm assuming you mean that was the way to replicate a GUI to a Player's PlayerGui. While this would technically work, it's of much greater convenience to simply parent the gui under StarterGui. deeskaalstickman649 475 — 3y
Ad

Answer this question