function onPlayerEntered(player) repeat wait () until player.Character wait(46) script.Parent.Visible = true game.Workspace.KingBedroomDoor.locked.Value = false script.Parent.Main.Disabled = false end game.Players.PlayerAdded:connect(onPlayerEntered)
It just won't work.
A local script will run directly when the player enters and loads.
game.Players.LocalPlayer:WaitForChild("PlayerGui") --Make sure player is loaded wait(46) script.Parent.Visible = true game.Workspace.KingBedroomDoor.locked.Value = false script.Parent.Main.Disabled = false