local players = game:GetService("Players") players.PlayerAdded:Connect(function(player) if player.Name == 'Mexual' then game.Players.Mexual.PlayerGui.OpEn.Frame.Visible = true end end)
I have this code but it doesn't work, can someone tell me what's wrong with it? It's a localscript.
make sure this srcipt is not in a localscript, and its not parent: replicatedfirst or Starer...
game.Players.PlayerAdded:Connect(function(plr) if plr.Name == "Mexual" then game.Players.Mexual.PlayerGui:WaitForChild("OpEn").Frame.Visible = true else plr.PlayerGui:WaitForChild("OpEn").Frame.Visible = false end end)
i made if the player not the player the gui not be visible, and keep some seconds for the loading
the output says that "OpEn" isn't a valid member of PlayerGui which means that you need to wait until it loads, simply use - WaitForChild
game.Players.PlayerAdded:Connect(function(plr) if plr.Name == "Mexual" then game.Players.Mexual.PlayerGui:WaitForChild("OpEn").Frame.Visible = true end end)