Okay, I have been attempting this a multitude of times but it never works does anyone know what I am doing wrong I write a script that checks the name of the players and if they are added to the script they will see the gui if not I have it set to disable it. But it don't do nothin.
The following is a script in workspace, which fires when a player joins the game. If the name of the player that joins the game is in the list of names in the table, the gui inside the player's playergui will be set to enabled.
Just make sure that you have your gui in startergui, so that it will be copied to player's playergui when they join. Also make sure that the name of said gui is "ScreenGui", and that enabled is set to false for that gui.
game.Players.PlayerAdded:connect(function(player) print("A player has entered: " .. player.Name) local list = {"123marble","yoyoy","Player"} -- Change these names to the people you want to be able to see the gui for i, v in pairs(list) do if v == player.Name then player.PlayerGui:WaitForChild("ScreenGui") player.PlayerGui.ScreenGui.Enabled = true end end end)
if this helped plz accept answer, and if you have any questions feel free to ask.
I haven't tested this so I am not sure if it will work but try this
Change the condition inside the if then statement
to whatever condition you want.
... local player = game.Players.LocalPlayer if player.Name = "Player" then gui.Visible = true end ...
Closed as Not Constructive by Goulstem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?