Basically, I want this StarterGui to pop up when a certain player is in the playerlist, in this case, my name. The script works perfectly fine on Studio but for some reason, when I try it in game, it doesn't even show. From what I can see, no errors are present. The Gui is in the StarterGui tab and the script (LocalScript) is running in the StarterPack tab (as this was the only place where it worked on Studio). Any help resolving this will be appreciated.
if game.Players.LocalPlayer.Name == "toughjohncena1256" or "Player1" then game.StarterGui.cars.ScrollingFrame.Visible = true game.StarterGui.cars.TEXT1.Visible = true game.StarterGui.cars.TEXT2.Visible = true game.StarterGui.cars.TEXT3.Visible = true game.StarterGui.cars.TEXT4.Visible = true end
The reason your code is not working is because you're accessing starterGUI instead of the players GUI. Also, you will want to wait for the Player's GUI to load.
local plr = game.Players.LocalPlayer plr:WaitForChild("PlayerGui")-- wait for GUI if plr.Name == "toughjohncena1256" or plr.Name == "Player1" then plr.PlayerGui.cars.ScrollingFrame.Visible = true plr.PlayerGui.cars.TEXT1.Visible = true plr.PlayerGui.cars.TEXT2.Visible = true plr.PlayerGui.cars.TEXT3.Visible = true plr.PlayerGui.cars.TEXT4.Visible = true end
That should work. Good luck!